cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A109653 Sequence and first differences include all prime numbers exactly once.

This page as a plain text file.
%I A109653 #10 Nov 05 2024 10:30:54
%S A109653 2,5,12,23,36,53,72,101,132,169,210,253,300,359,420,487,558,631,710,
%T A109653 793,882,979,1082,1189,1298,1411,1538,1669,1806,1945,2094,2245,2402,
%U A109653 2565,2732,2905,3084,3265,3456,3649,3846,4045,4256,4479,4706,4935,5168,5407
%N A109653 Sequence and first differences include all prime numbers exactly once.
%C A109653 Sequence and first differences:
%C A109653 2 5 12 23 36 53 72 101 132 169 210 253 300 359 420...
%C A109653 .3.7.11.13.17.19.29...31..37..41..43..47..59..61...
%e A109653 All prime numbers appear once and only once, either in the sequence itself or in the first differences.
%p A109653 A109653diff :=proc(n)
%p A109653     option remember ;
%p A109653     if n = 2 then
%p A109653         3;
%p A109653     else
%p A109653         for pidx from 1 do
%p A109653             fnd := false;
%p A109653             p := ithprime(pidx) ;
%p A109653             for i from 2 to n-1 do
%p A109653                 if procname(i) = p then
%p A109653                     fnd := true;
%p A109653                 end if;
%p A109653             end do:
%p A109653             for i from 2 to n do
%p A109653                 if A109653(i) = p then
%p A109653                     fnd := true;
%p A109653                 end if;
%p A109653             end do:
%p A109653             if not fnd then
%p A109653                 return p;
%p A109653             end if;
%p A109653         end do:
%p A109653     end if;
%p A109653 end proc:
%p A109653 A109653 :=proc(n)
%p A109653     if n = 2 then
%p A109653         2 ;
%p A109653     else
%p A109653         procname(n-1)+A109653diff(n-1) ;
%p A109653     end if;
%p A109653 end proc:
%p A109653 seq(A109653(n),n=2..80) ; # _R. J. Mathar_, Nov 05 2024
%t A109653 NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = {1}; d = 3; k = 2; Do[ While[ Position[a, d] != {}, d += 2 ]; k = k + d; d = NextPrim[d]; a = Append[a, k], {n, 47} ]; a (* _Robert G. Wilson v_ *)
%Y A109653 Cf. A247657
%K A109653 base,easy,nonn
%O A109653 2,1
%A A109653 _Eric Angelini_, Aug 30 2005
%E A109653 More terms from _Robert G. Wilson v_, Sep 28 2005