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!)
A078652 a(1)=1, a(2n)=nextprime(a(n-1)), a(2n+1)= sum of digits of all previous terms + 1. 0
1, 2, 4, 5, 13, 17, 25, 29, 43, 47, 61, 67, 81, 83, 101, 103, 107, 109, 125, 127, 143, 149, 165, 167, 191, 193, 215, 223, 230, 233, 243, 251, 260, 263, 279, 281, 308, 311, 324, 331, 340, 347, 361, 367, 387, 389, 425, 431, 444, 449, 473, 479, 507, 509, 533, 541 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..56.

MATHEMATICA

lst={1}; i=1; Do[If[EvenQ[n], AppendTo[lst, NextPrime[Last[lst]]], AppendTo[ lst, Total[ Flatten[ IntegerDigits/@ lst]]]]; i++, {n, 60}]; Rest[lst] (* Harvey P. Dale, Sep 03 2011 *)

PROG

(PARI) digitsum(n) = local(s, d); s=0; while(n>0, d=divrem(n, 10); n=d[1]; s=s+d[2]); s {sdnp(m)=local(a=1, ct=0, lp=0, ls=0, sqc=0, sr=0, t=1); for(n=1, m, if(n%2==0, b=nextprime(a+1); t+=digitsum(b); a=b; ct++; print1(b, " "); if(issquare(b), sqc++; ls=b; ); sr+=(1.0/b), b=t; t+=digitsum(b); a=b; print1(b, " "); if(isprime(b), ct++; lp=b; ); if(issquare(b), sqc++; ls=b; ); sr+=(1.0/b); )); print(); print(Results); print("Found "ct" primes <= "m); print("Found "sqc" squares <= "m); print("Last prime found in odd part: "lp); print("Last square found: "ls); print("Ratio of primes to "m" is "ct/m+0.0); print("Sum of reciprocals = "sr); }

CROSSREFS

Sequence in context: A128457 A139485 A079407 * A289491 A102992 A273097

Adjacent sequences:  A078649 A078650 A078651 * A078653 A078654 A078655

KEYWORD

base,easy,nonn

AUTHOR

Jason Earls, Dec 14 2002

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 7 04:20 EDT 2020. Contains 333292 sequences. (Running on oeis4.)