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.

A122257 Characteristic function of Pierpont primes (A005109).

This page as a plain text file.
%I A122257 #21 May 14 2025 04:27:36
%S A122257 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,
%T A122257 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,
%U A122257 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
%N A122257 Characteristic function of Pierpont primes (A005109).
%H A122257 Antti Karttunen, <a href="/A122257/b122257.txt">Table of n, a(n) for n = 1..65537</a>
%H A122257 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PierpontPrime.html">Pierpont Prime</a>.
%H A122257 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.
%F A122257 a(n) = A010051(n) * A065333(n-1).
%F A122257 a(n) = if (n is prime) and (n-1 is 3-smooth) then 1 else 0.
%F A122257 a(n) = if n=1 then 0 else A122258(n) - A122258(n-1);
%F A122257 a(A122259(n)) = 0, a(A005109(n)) = 1.
%t A122257 smooth3Q[n_] := n == 2^IntegerExponent[n, 2]*3^IntegerExponent[n, 3];
%t A122257 a[n_] := Boole[PrimeQ[n] && smooth3Q[n - 1]];
%t A122257 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Oct 16 2021 *)
%o A122257 (Scheme)
%o A122257 (define (A122257 n) (if (= 1 n) 0 (if (= 1 (A065333 (- n 1))) (A010051 n) 0)))
%o A122257 (define (A065333 n) (if (= 1 (A038502 (A000265 n))) 1 0))
%o A122257 ;; _Antti Karttunen_, Dec 07 2017
%o A122257 (PARI) is3smooth(n) = my(m = n >> valuation(n, 2)); m == 3^valuation(m, 3);
%o A122257 a(n) = isprime(n) && is3smooth(n-1); \\ _Amiram Eldar_, May 14 2025
%Y A122257 Cf. A005109, A010051, A065333, A122258 (partial sums).
%K A122257 nonn
%O A122257 1,1
%A A122257 _Reinhard Zumkeller_, Aug 29 2006