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.

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.

This page as a plain text file.
%I A245359 #7 Jul 19 2014 09:48:33
%S A245359 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,
%T A245359 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,
%U A245359 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
%N 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.
%C A245359 If a(n) = K and reorder the digits of n to make a new number, n'. Thus, a(n') = K.
%F A245359 a(A031974(n)) = -1 for all n.
%e A245359 1^1 + 2^1 = 3 is prime.
%e A245359 1^2 + 2^2 = 5 is prime.
%e A245359 1^3 + 2^3 = 9 is not prime.
%e A245359 So a(12) and a(21) = 2.
%o A245359 (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)
%o A245359 n=1;while(n<100,print1(a(n),", "); n++)
%K A245359 sign,base
%O A245359 1,12
%A A245359 _Derek Orr_, Jul 18 2014