login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254032 a(0)=0, a(1)=1; for n > 2, a(n) is the smallest prime factor of a(n-1) + a(n-2) not already in the sequence or, if there is no such prime, a(n) = a(n-1) + a(n-2). 1
0, 1, 1, 2, 3, 5, 8, 13, 7, 20, 27, 47, 37, 84, 11, 19, 30, 49, 79, 128, 23, 151, 29, 180, 209, 389, 598, 987, 317, 163, 480, 643, 1123, 883, 17, 900, 131, 1031, 83, 557, 640, 1197, 167, 31, 198, 229, 61, 290, 351, 641, 992, 71, 1063, 1134, 2197, 3331, 691 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
From Kellen Myers, May 10 2015: (Start)
Empirically this sequence grows slower than A000045(n), the Fibonacci sequence, but faster than log(A000045(n)).
Note that in the case where no suitable prime divisor exists, a(n) must take the value a(n-1) + a(n-2) regardless of whether it appears previously. This allows for repetition, e.g., a(86)=a(99)=957. Among the first 1000 terms, there are 9 values a(n) takes twice. (End)
LINKS
EXAMPLE
The first nonprime Fibonacci number is F(5)=8, and so this is the first place that a(n) could disagree with F(n). However, the only prime factor of 8 is 2, which appears as a(2), and thus a(5) must be 8.
For n=7, a(n-1) + a(n-2) = 21. The prime factors of 21 are 3 and 7, and 7 has not yet appeared, so a(7)=7.
MATHEMATICA
a[n_] := a[n] =
Module[{set = seq[n - 1], val = a[n - 1] + a[n - 2], p},
p = 2;
While[(Mod[val, p] != 0 || MemberQ[set, p]) && p <= val,
p = NextPrime[p]
];
If[p > val, Return[val], Return[p]];
];
seq[n_] := seq[n] = Append[seq[n - 1], a[n]]
a[1] = 0; a[2] = 1;
seq[2] = {0, 1};
(* Kellen Myers, May 10 2015 *)
CROSSREFS
Sequence in context: A105995 A360931 A214094 * A214365 A104701 A309782
KEYWORD
nonn
AUTHOR
David S. Newman, Jan 22 2015
EXTENSIONS
Clarification of definition, examples by Kellen Myers, May 10 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 03:41 EDT 2024. Contains 371264 sequences. (Running on oeis4.)