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.

A172216 Smallest k such that sum of digits of prime(n)^k is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 1, 7, 2, 1, 1, 1, 2, 5, 1, 1, 6, 2, 2, 1, 1, 4, 1, 4, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 4, 6, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 5, 6, 1, 4, 4, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 1, 1, 1, 8, 2, 1, 1, 2, 1, 1, 5, 2, 1, 1, 1, 8, 1, 4, 2, 3, 1, 1, 2, 1, 1, 1, 4, 1, 8, 3, 2, 6, 2, 3, 6, 2, 1, 10, 8, 1
Offset: 1

Views

Author

Klaus Brockhaus, Jan 29 2010

Keywords

Comments

For all n, prime(n)^0 = 1 has nonprime sum of digits 1.
a(n) = 1 iff prime(n) is in A046704, an additive prime. a(n) = 1 iff n is in A075177.

Examples

			prime(1) = 2; 2^1 = 2 has prime sum of digits 2. Hence a(1) = 1.
prime(6) = 13; 13^1 = 13 has nonprime sum of digits 4; 13^2 = 169 has nonprime sum of digits 16; 13^3 = 2197 has prime sum of digits 19. Hence a(6) = 3.
		

Crossrefs

Programs

  • Magma
    S:=[]; for n in [1..105] do j:=1; while not IsPrime(&+Intseq(NthPrime(n)^j)) do j+:=1; end while; Append(~S, j); end for; S;
  • Mathematica
    sdp[n_]:=Module[{k=1},While[!PrimeQ[Total[IntegerDigits[Prime[n]^k]]], k++]; k]; Array[sdp,110] (* Harvey P. Dale, Apr 13 2014 *)

A178237 Smallest prime p of the form prime(n)+k^2 such that sum of digits(p) = prime(n).

Original entry on oeis.org

2, 3, 5, 7, 47, 157, 593, 919, 599, 66593, 46687, 396937, 467897, 467899, 6969647, 16499897, 367488959, 598095997, 2977884967, 4977866987, 2797986889, 58888728979, 58987779959, 679585896989, 4989996468997
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 23 2010

Keywords

Comments

It is still an open problem if there exist infinitely many primes of form k^2 + d (d integer, no negative square).
For n<=4, k=0 suffices: e.g. prime(1)+0^2=2 = sum of digits(prime(1)), so a(n)=prime(n).

Examples

			a(13) = 467897 because its digitsum is 41 which is the 13th prime, it is of the form prime(13)+k^2 with k=684, and it is the least such prime.
		

Crossrefs

Programs

  • PARI
    sod(n) = {digs = digits(n, 10); return (sum(j=1, #digs, digs[j]));}
    a(n) = {k = 0; p = prime(n); while (! (isprime(q=p+k^2) && (sod(q) == p)), k++); return (q);} \\ Michel Marcus, Jul 26 2013

Extensions

a(5) corrected and sequence extended by D. S. McNeil, May 25 2010
Showing 1-2 of 2 results.