login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A330139 a(1)=1 and a(2)=1; if a(n-1)+a(n-2) == 0 mod n then a(n) = (a(n-1)+a(n-2))/n else a(n) = a(n-1)+a(n-2). 2
1, 1, 2, 3, 1, 4, 5, 9, 14, 23, 37, 5, 42, 47, 89, 136, 225, 361, 586, 947, 73, 1020, 1093, 2113, 3206, 5319, 8525, 13844, 22369, 36213, 58582, 94795, 153377, 248172, 401549, 649721, 1051270, 1700991, 2752261, 4453252, 7205513, 11658765, 18864278, 30523043, 49387321, 79910364, 129297685, 209208049, 338505734, 547713783 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..4800

FORMULA

if a(n-1)+a(n-2) == 0 mod n then a(n) = (a(n-1)+a(n-2))/n else a(n) = a(n-1)+a(n-2).

a(n) != a(n-1) + a(n-2) for n in { A333578 }.

EXAMPLE

a(5) = 1 because a(4)+a(3) = 5, and 5 mod 5 is equals 0, then a(5) = (a(4)+a(3))/5 = 1.

MAPLE

a:= proc(n) option remember; `if`(n<2, n, (t->

      `if`(irem(t, n)=0, t/n, t))(a(n-1)+a(n-2)))

    end:

seq(a(n), n=1..50);  # Alois P. Heinz, Mar 28 2020

MATHEMATICA

a[1] = a[2] = 1; a[n_] := a[n] = If[Divisible[(s = a[n-1] + a[n-2]), n], s/n, s]; Array[a, 50] (* Amiram Eldar, Dec 02 2019 *)

PROG

(Pascal)

Begin

.....n1[1]:=1;

.....n1[2]:=1;

.....writeln(n1[1], ', ');

.....writeln(n1[2], ', ');

.....for n2:=3 to 100 do

.....begin

........n1[n2] := n1[n2-1]+n1[n2-2];

........if n1[n2]mod(n2) = 0 then

........begin

...........n1[n2] := int(n1[n2]/n2);

........end;

........writeln(n1[n2], ', ');

.....end;

End.

CROSSREFS

Cf. A000045, A333578.

Sequence in context: A305433 A257681 A265755 * A046671 A178760 A235715

Adjacent sequences:  A330136 A330137 A330138 * A330140 A330141 A330142

KEYWORD

nonn,easy,changed

AUTHOR

Eder Vanzei, Dec 02 2019

EXTENSIONS

Incorrect conjectured g.f. removed by Alois P. Heinz, Mar 28 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 6 08:53 EDT 2020. Contains 333268 sequences. (Running on oeis4.)