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.

Showing 1-2 of 2 results.

A252670 a(n) is exponential digital index of prime(n).

Original entry on oeis.org

22, 0, 11, 4, 2, 0, 0, 2, 1, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 2, 1, 2, 1, 0, 0, 0, 0, 0, 2, 0, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 3, 1, 0, 0, 0, 2, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 1, 0, 0, 5, 0, 2, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Vladimir Shevelev, Dec 20 2014

Keywords

Comments

For the definition of the exponential digital index of a prime p (EDI(p)), see comment in A252668.
Is 22 the maximal term? Is 11 the second maximal term?

Crossrefs

Programs

  • PARI
    s(k, pp) = my(sd = sumdigits(pp^k)); sd/2^valuation(sd, 2);
    f(n, pp) = {my(p = prime(n), k = 1); while ((sk=s(k, pp)) % p, k++); if (sk == p, k, 0); }
    a(n) = {my(pp=prime(n), j=3); while (f(j,pp), j++); j - 3;} \\ Michel Marcus, Dec 09 2018

Formula

a(n)=0, iff n is not in A251964; a(n)=1, iff n is in A251964, but is not A252280;
a(n)=2, iff n is in A251964 & A252980, but is not in A252981, a(n)>=3, iff n is in A251964 & A252980 & A252281.

Extensions

More terms from Michel Marcus, Dec 09 2018

A252732 In view of their definitions, let us refer to A251964 as sequence "5", A252280 as sequence "7", and similarly define sequence "prime(n)"; a(n) is the third term of the intersection of sequences "5", ..., "prime(n)".

Original entry on oeis.org

7, 7, 7, 7, 421, 2311, 43321, 59730109, 537052693
Offset: 3

Views

Author

Vladimir Shevelev, Dec 21 2014

Keywords

Comments

Is this sequence finite?
Up to n=13, the first two terms of the intersection of sequences "5", ..., "prime(n)" are 2 and 5 respectively.

Crossrefs

Programs

  • Mathematica
    s[p_, k_] := Module[{s = Total[IntegerDigits[p^k]]}, s/2^IntegerExponent[s, 2]]; f[p_,q_] := Module[{k = 1}, While[ ! Divisible[s[p, k], q], k++]; k]; okQ[p_,q_] := s[p, f[p,q]] == q; okpQ[p_,nbseq_] := Module[{ans=True}, Do[If[!okQ[p,Prime[k+2]], ans=False; Break[]],{k,1,nbseq}]; ans]; a[n_]:=Module[{c=0, p=2},While[c<3 , If[okpQ[p,n],c++];p=NextPrime[p]];NextPrime[p,-1]]; Array[a,6] (* Amiram Eldar, Dec 09 2018 *)
  • PARI
    s(p, k) = my(s=sumdigits(p^k)); s >> valuation(s, 2);
    f(p, vp) = my(k=1); while(s(p,k) % vp, k++); k;
    isok(p, vp) = s(p, f(p, vp)) == vp;
    isokp(p, nbseq) = {for (k=1, nbseq, if (! isok(p, prime(k+2)), return (0));); return (1);}
    a(n) = {my(nbpok = 0); forprime(p=2, oo, if (isokp(p, n), nbpok ++); if (nbpok == 3, return (p)););} \\ Michel Marcus, Dec 09 2018

Extensions

More terms from Peter J. C. Moses, Dec 21 2014
a(10)-a(11) from Michel Marcus, Dec 09 2018
Showing 1-2 of 2 results.