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.

A239735 Least number k such that n*k^n +/- 1 are twin primes, or a(n) = 0 if no such number exists.

This page as a plain text file.
%I A239735 #119 Nov 24 2023 09:00:10
%S A239735 4,3,4,1,570,1,1464,54,60,14025,1932,1,7194,15,3612,0,4746,1,540,150,
%T A239735 7060,138,80094,6160,33480,93135,0,366618,26058,1,90510,16836,9824,
%U A239735 418875,57246,0,182394,64077,14178,943410,36078,1,314520,15870,194942,15044700,241944,3871,308730
%N A239735 Least number k such that n*k^n +/- 1 are twin primes, or a(n) = 0 if no such number exists.
%C A239735 a(n) = 1 iff n is in A014574.
%C A239735 If a(n) = 0, then n is in A097764.
%C A239735 If a(n) > 1 then A367566(n) divides a(n). - _Jon E. Schoenfield_, Nov 23 2023
%H A239735 Jon E. Schoenfield, <a href="/A239735/b239735.txt">Table of n, a(n) for n = 1..200</a> (first 77 terms from Michel Marcus)
%e A239735 1*1^1+1 (2) and 1*1^1-1 (0) are not both prime. 1*2^1+1 (3) and 1*2^1-1 (1) are not both prime. 1*3^1+1 (4) and 1*3^1-1 (2) are not both prime. 1*4^1+1 (5) and 1*4^1-1 (3) are both prime. So, a(1) = 4.
%t A239735 zeroQ[n_] := Module[{f = FactorInteger[n]}, pow = GCD @@ f[[;; , 2]]; n > 4 && AnyTrue[Divisors[pow], # > 1 && Divisible[n, #] &]];
%t A239735 a[n_, kmax_] := Module[{k = 1}, If[zeroQ[n], 0, While[k <= kmax && ! And @@ PrimeQ[n*k^n + {-1, 1}], k++]; If[k < kmax, k, -1]]]; Table[a[n, 10^6], {n, 1, 25}] (* _Amiram Eldar_, Nov 18 2023, returns -1 if the search limit should exceed kmax *)
%o A239735 (PARI) bot(n) = for(k=1, 10^5, if(ispseudoprime(n*k^n-1), if(ispseudoprime(n*k^n+1), return(k))));
%o A239735 n=1; while(n<100, print1(bot(n), ", "); n+=1)
%o A239735 (PARI) a(n) = if ((n==16) || (n==27) || (n==36) || (n==64) /* || (n== ... */, return(0)); my(k=1); while (!(ispseudoprime(n*k^n-1) && ispseudoprime(n*k^n+1)), k++); k; \\ _Michel Marcus_, Nov 18 2023
%Y A239735 Cf. A097764, A014574, A239938, A239666, A367566.
%K A239735 nonn
%O A239735 1,1
%A A239735 _Derek Orr_, Mar 30 2014
%E A239735 a(46) from _Giovanni Resta_, Mar 31 2014