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!)
A245359 Largest number k such that d_1^j + d_2^j + … + d_r^j is prime for all j = 1, 2, .. k, or 0 if no such k exists, where d_1, d_2, … d_r are the digits of n. a(n) = -1 if k is infinite. 0
0, 1, 1, 0, 1, 0, 1, 0, 0, 0, -1, 2, 0, 2, 0, 2, 0, 0, 0, 1, 2, 0, 2, 0, 2, 0, 0, 0, 1, 1, 0, 2, 0, 1, 0, 0, 0, 2, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 1, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 0, 1, 0, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,12

COMMENTS

If a(n) = K and reorder the digits of n to make a new number, n'. Thus, a(n') = K.

LINKS

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

FORMULA

a(A031974(n)) = -1 for all n.

EXAMPLE

1^1 + 2^1 = 3 is prime.

1^2 + 2^2 = 5 is prime.

1^3 + 2^3 = 9 is not prime.

So a(12) and a(21) = 2.

PROG

(PARI) a(n) = for(k=1, 10^3, d=digits(n); if(!ispseudoprime(sum(i=1, #d, d[i]^k)), return(k-1))); return(-1)

n=1; while(n<100, print1(a(n), ", "); n++)

CROSSREFS

Sequence in context: A039970 A179212 A105118 * A103271 A029832 A320535

Adjacent sequences:  A245356 A245357 A245358 * A245360 A245361 A245362

KEYWORD

sign,base

AUTHOR

Derek Orr, Jul 18 2014

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 July 13 05:17 EDT 2020. Contains 335673 sequences. (Running on oeis4.)