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.

A240509 Least number k > 0 such that n^k - (n-1)^k - ... - 3^k - 2^k is prime, or 0 if no such k exists.

This page as a plain text file.
%I A240509 #29 Apr 15 2014 02:58:00
%S A240509 1,2,2,0,0,4,5,0,0,10,27,0,0,13,18,0,0,26,57,0,0,16,35,0,0,219,19,0,0,
%T A240509 373,48,0,0,35,33,0,0,94,93,0,0,225,47,0,0,47,223,0,0,3227,49,0,0,199,
%U A240509 127,0,0,45,67,0,0,65,123,0,0,103
%N A240509 Least number k > 0 such that n^k - (n-1)^k - ... - 3^k - 2^k is prime, or 0 if no such k exists.
%C A240509 a(n) = 0 if and only if n == 1 or 2 mod 4. This is because of the parity of the number given. For n = 1, 2, 5, 6, 9, 10, 13, 14,... any k-value will return an even number. Thus, it will never be prime. The only exception is for n = 1, where it will return 1, still not a prime. Further when n = 2, it only returns even numbers; however, 2 is a prime and thus, a(2) = 1.
%C A240509 A prime number is in the sequence A000040.
%C A240509 Next term a(68) is most likely > 5000.
%e A240509 7^1 - 6^1 - 5^1 - 4^1 - 3^1 - 2^1 = -13 is not prime. 7^2 - 6^2 - 5^2 - 4^2 - 3^2 - 2^2 = -41 is not prime. 7^3 - 6^3 - 5^3 - 4^3 - 3^3 - 2^3 = -97 is not prime. 7^4 - 6^4 - 5^4 - 4^4 - 3^4 - 2^4 = 127 is prime. Thus, a(7) = 4.
%o A240509 (PARI) a(n)=for(k=1,5000,if(ispseudoprime(n^k-sum(i=2,n-1,i^k)),return(k)));
%o A240509 n=1; while(n<100,print1(a(n), ", ");n+=1)
%Y A240509 Cf. A042963, A057468, A138699.
%K A240509 nonn,more
%O A240509 2,2
%A A240509 _Derek Orr_, Apr 06 2014