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.
%I A252655 #36 May 22 2025 10:21:41 %S A252655 5,5,7,5,43,13,7,5,241,13,43,41,19,41,7,5,13,83,43,229,811,41,31,167, %T A252655 811,127,367,419,79,43,43,83,673,19,109,83,13,331,523,409,199 %N A252655 Smallest prime p with property that the sum of the n-th power of the successive gaps between primes <= p is also a prime number. %C A252655 First appearance of p, by power, beginning with 5: 1, 3, ??, 6, ??, 13, ??, 86, 23, ??, 12, 5, ... . - _Robert G. Wilson v_, Jan 11 2015 %H A252655 Robert G. Wilson v, <a href="/A252655/b252655.txt">Table of n, a(n) for n = 1..1000</a> (first 100 terms from Abhiram R Devesh) %e A252655 n=1: p=5; primes less than or equal to 5: [2, 3, 5]; prime gaps: [1, 2]; sum of prime gaps: 3. %e A252655 n=2: p=5; primes less than or equal to 5: [2, 3, 5]; squares of prime gaps: [1, 4]; sum of squares of prime gaps: 5. %e A252655 n=3: p=7; primes less than or equal to 7: [2, 3, 5, 7]; cubes of prime gaps: [1, 8, 8]; sum of cubes of prime gaps: 17. %e A252655 n=4: p=5; primes less than or equal to 5: [2, 3, 5]; 4th power of prime gaps: [1, 16]; sum of 4th power of prime gaps: 17. %t A252655 f[n_] := Block[{p = 2, s = 0}, While[ !PrimeQ@ s, q = NextPrime@ p; s = s + (q - p)^n; p = q]; p]; Array[f, 60] (* _Robert G. Wilson v_, Jan 11 2015 *) %o A252655 (Python) %o A252655 import sympy %o A252655 c=1 %o A252655 while c>0: %o A252655 p=2 %o A252655 d=0 %o A252655 s=0 %o A252655 while p>0: %o A252655 s=s+(d**c) %o A252655 sp=sympy.isprime(s) %o A252655 if sp ==True: %o A252655 print(c,p) %o A252655 p=-1 %o A252655 c=c+1 %o A252655 else: %o A252655 np=sympy.nextprime(p) %o A252655 d=np-p %o A252655 p=np %Y A252655 Cf. A006512, A247177, A247178, A251623. %K A252655 nonn %O A252655 1,1 %A A252655 _Abhiram R Devesh_, Dec 19 2014