A122257 Characteristic function of Pierpont primes (A005109).
0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Eric Weisstein's World of Mathematics, Pierpont Prime.
- Index entries for characteristic functions.
Programs
-
Mathematica
smooth3Q[n_] := n == 2^IntegerExponent[n, 2]*3^IntegerExponent[n, 3]; a[n_] := Boole[PrimeQ[n] && smooth3Q[n - 1]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 16 2021 *)
-
PARI
is3smooth(n) = my(m = n >> valuation(n, 2)); m == 3^valuation(m, 3); a(n) = isprime(n) && is3smooth(n-1); \\ Amiram Eldar, May 14 2025
-
Scheme
(define (A122257 n) (if (= 1 n) 0 (if (= 1 (A065333 (- n 1))) (A010051 n) 0))) (define (A065333 n) (if (= 1 (A038502 (A000265 n))) 1 0)) ;; Antti Karttunen, Dec 07 2017