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!)
A225385 Construct sequences P,Q,R by the rules: Q = first differences of P, R = second differences of P, P starts with 1,3,9, Q starts with 2,6, R starts with 4; at each stage the smallest number not yet present in P,Q,R is appended to R. Sequence gives P. 4

%I #23 Mar 06 2023 09:12:13

%S 1,3,9,20,38,64,100,148,209,284,374,480,603,745,908,1093,1301,1533,

%T 1790,2074,2386,2727,3098,3500,3934,4401,4902,5438,6011,6623,7275,

%U 7968,8703,9481,10303,11170,12083,13043,14052,15111,16221,17383,18598,19867,21191,22571,24008,25503,27057,28671,30347,32086,33890,35760,37697,39702,41776,43920

%N Construct sequences P,Q,R by the rules: Q = first differences of P, R = second differences of P, P starts with 1,3,9, Q starts with 2,6, R starts with 4; at each stage the smallest number not yet present in P,Q,R is appended to R. Sequence gives P.

%C In contrast to A225376-A225378, here it is not required (and not true) that each number should appear just once in P union Q union R. On the other hand, again in contrast to A225376-A225378, here it is obvious that P, Q, R are infinite.

%C The first three numbers that are repeated are 284, 2074, 3500, which appear in both P and Q. There may be no others. Of course R is disjoint from P and Q, by definition.

%p # Based on _Christopher Carl Heckman_'s program for A225376.

%p f:=proc(N) local h,dh,ddh,S,mex,i;

%p h:=1,3,9; dh:=2,6; ddh:=4; mex:=5; S:={h,dh,ddh};

%p for i from 4 to N do

%p while mex in S do S:=S minus {mex}; mex:=mex+1; od;

%p ddh:=ddh,mex; dh:=dh,dh[-1]+mex; h:=h,h[-1]+dh[-1];

%p S:=S union {h[-1], dh[-1], ddh[-1]};

%p mex:=mex+1;

%p od;

%p RETURN([[h],[dh],[ddh]]);

%p end;

%p f(100);

%t f[N_] := Module[{P = {1, 3, 9}, Q = {2, 6}, R = {4}, S, mex = 5, i},

%t S = Join[P, Q, R];

%t For[i = 4, i <= N, i++,

%t While[MemberQ[S, mex], S = S~Complement~{mex}; mex++];

%t AppendTo[R, mex];

%t AppendTo[Q, Q[[-1]] + mex];

%t AppendTo[P, P[[-1]] + Q[[-1]]];

%t S = S~Union~{P[[-1]], Q[[-1]], R[[-1]]}; mex++];

%t P];

%t f[100] (* _Jean-François Alcover_, Mar 06 2023, after Maple code *)

%Y Cf. A225386, A225387, A005228, A030124, A037257, A225376, A225377, A225378.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, May 15 2013

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)