OFFSET
1,1
COMMENTS
From Michel Marcus, Feb 09 2022: (Start)
FORMULA
EXAMPLE
PROG
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a258437 = (+ 1) . fromJust . (`elemIndex` a258383_list)
(PARI) f(n) = 2*prime(n) - prime(n+1); \\ A062234
lista(nn) = {my(vp=primes(nn)); my(v=vector(nn-1, k, 2*vp[k] - vp[k+1]), last=v[1], nb=1, list=List()); kill(vp); for (n=2, nn-1, if (v[n]==last, nb++, listput(list, nb); last=v[n]; nb=1); ); Vec(list); } \\ A258383
find(k, v) = {my(i=1); while (v[i] != k, i++); i; }
listr(nn) = {my(v=lista(nn)); for (k=1, 6, my(pos = find(k, v)); print1(sum(i=1, pos, v[i])- k + 1, ", "); ); }
listr(9*10^7) \\ Michel Marcus, Feb 09 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Reinhard Zumkeller, May 31 2015
EXTENSIONS
New name and a(6) from Michel Marcus, Feb 09 2022
STATUS
approved