|
|
A076368
|
|
a(1) = 1; for n > 1, a(n) = prime(n) - prime(n-1) + 1.
|
|
10
|
|
|
1, 2, 3, 3, 5, 3, 5, 3, 5, 7, 3, 7, 5, 3, 5, 7, 7, 3, 7, 5, 3, 7, 5, 7, 9, 5, 3, 5, 3, 5, 15, 5, 7, 3, 11, 3, 7, 7, 5, 7, 7, 3, 11, 3, 5, 3, 13, 13, 5, 3, 5, 7, 3, 11, 7, 7, 7, 3, 7, 5, 3, 11, 15, 5, 3, 5, 15, 7, 11, 3, 5, 7, 9, 7, 7, 5, 7, 9, 5, 9, 11, 3, 11, 3, 7, 5, 7, 9, 5, 3, 5, 13, 9, 5, 9, 5, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
For n>1, a(n) is the sum of the digits of prime(n) in the base prime(n-1). - R. J. Cano, Dec 31 2016; corrected by Michel Marcus, Jan 01 2017
|
|
LINKS
|
|
|
MATHEMATICA
|
c[x_, j_] := x+1-(j+Prime[j])c[x, 0]=x; a=1000; t=Table[0, {a}]; t1=Table[0, {a}]; Table[fl=1; (*Print["% ", u, " #"]; *)Do[s=c[u, n]; If[Equal[fl, 1]&&Equal[Sign[s], -1], Print[n]; t[[u]]=n; t1[[u]]=Prime[n]; fl=0], {n, 1, u}], {u, 1, a}]//t (*=A060646*)//t1 (*=A076367*) Table[Count[t, j], {j, 1, PrimePi[a]}]
(* Second program *)
Table[If[n == 1, 1, (Prime@ n - Prime[n - 1]) + 1], {n, 97}] (* Michael De Vlieger, Dec 31 2016 *)
Join[{1}, Differences[Prime[Range[100]]]+1] (* Harvey P. Dale, Mar 13 2019 *)
|
|
PROG
|
(Magma) [1] cat [NthPrime(n)-NthPrime(n-1)+1: n in [1..80]]; // Vincenzo Librandi, Jan 01 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|