Lucas Numbers

39 views
Skip to first unread message

John Hanna

unread,
Jul 3, 2025, 7:45:31 AMJul 3
to 'Andy Kemp' via tinspire
Puzzling over a problem:

Lucas Numbers are a sequence like Fibonacci Numbers but with any two starting numbers. What's the longest Lucas sequence that contains the number 1,000,000?

Thinking about working backwards from 1,000,000...?

Regards,
    John

Bert Wikkerink

unread,
Jul 3, 2025, 2:06:58 PMJul 3
to tins...@googlegroups.com
I found:
{154,144,298,442,740,1182,1922,3104,5026,8130,13156,21286,34442,55728,90170,145898,236068,381966,618034,1000000}

Just brute force in a Python program

Regards,

Bert





Op 3 jul 2025, om 13:45 heeft John Hanna <johne...@gmail.com> het volgende geschreven:

Puzzling over a problem:

Lucas Numbers are a sequence like Fibonacci Numbers but with any two starting numbers. What's thelongest Lucas sequence that contains the number 1,000,000?

Thinking about working backwards from 1,000,000...?

Regards,
    John

-- 
-- 
To post to this group, send email to tins...@googlegroups.com
Unsubscribe by sending an email to tinspire+u...@googlegroups.com
The tns documents shared by group members are archived at 
https://sites.google.com/site/tinspiregroup/tns-files
--- 
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tinspire/BL0PR16MB2546E43A9294B5B6E839E95FA243A%40BL0PR16MB2546.namprd16.prod.outlook.com.

John Hanna

unread,
Jul 3, 2025, 3:20:31 PMJul 3
to tinspire
Yeah... 618043/1000000=phi

John Hanna

John Hanna

unread,
Jul 3, 2025, 4:29:34 PMJul 3
to tins...@googlegroups.com
Let's see the code!

Regards,
    John

From: tins...@googlegroups.com <tins...@googlegroups.com> on behalf of Bert Wikkerink <b.wik...@gmail.com>
Sent: Thursday, July 3, 2025 2:06 PM
To: tins...@googlegroups.com <tins...@googlegroups.com>
Subject: Re: [tinspire] Lucas Numbers
 

Bert Wikkerink

unread,
Jul 4, 2025, 2:53:36 AMJul 4
to tins...@googlegroups.com
For the code see below.
(I also included a tns-file) 

Regards,
Bert


# make a list of fibonacci numbers
fib=[1,1]
for i in range(2,31):
  fib.append(fib[i-2]+fib[i-1])

#define a Lucas number
def lucas(a,b,n):
  return fib[n-1]*a+fib[n]*b

#check for different starting numbers a and b the
#lucas numbers less than or equal to 1000000

for a in range(1,1000):
  for b in range(1,1000):
    n=1
    luc=0
    while luc<=1000000:
      luc = lucas(a,b,n)
      if luc == 1000000:
        print(a,b,n+1,luc)
        break
      n = n+1


Lucas.tns

John Hanna

unread,
Jul 4, 2025, 8:45:10 AMJul 4
to tinspire
I did something similar but with no results.

John Hanna

--
--
To post to this group, send email to tins...@googlegroups.com
Unsubscribe by sending an email to tinspire+u...@googlegroups.com
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/tns-files
---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

--
--
To post to this group, send email to tins...@googlegroups.com
Unsubscribe by sending an email to tinspire+u...@googlegroups.com
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/tns-files
---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

John Hanna

unread,
Jul 5, 2025, 7:17:01 AMJul 5
to tinspire, johne...@gmail.com
Had to tweak the code but found others:
Regards,
    John

From: John Hanna <johne...@gmail.com>
Sent: Friday, July 4, 2025 8:44 AM
To: tinspire <tins...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages