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.

A081309 Smallest prime p such that n-p is a 3-smooth number, a(n)=0 if no such prime exists.

This page as a plain text file.
%I A081309 #17 Oct 14 2021 12:55:17
%S A081309 0,0,2,2,2,2,3,2,3,2,2,3,5,2,3,7,5,2,3,2,3,13,5,23,7,2,3,19,2,3,7,5,
%T A081309 17,2,3,0,5,2,3,13,5,41,7,17,13,19,11,47,13,2,3,43,5,53,7,2,3,31,5,59,
%U A081309 7,53,31,37,11,2,3,41,5,43,7,71,19,2,3,67,5,0,7,53,17,73,2,3,13,5,23,7,17,89
%N A081309 Smallest prime p such that n-p is a 3-smooth number, a(n)=0 if no such prime exists.
%H A081309 Reinhard Zumkeller, <a href="/A081309/b081309.txt">Table of n, a(n) for n = 1..10000</a>
%F A081309 a(n)=0 iff A081308(n)=0.
%e A081309 a(25)=7: 25=7+2*3^2.
%t A081309 smooth3Q[n_] := n/2^IntegerExponent[n, 2]/3^IntegerExponent[n, 3] == 1;
%t A081309 a[n_] := Module[{p}, For[p = 2, p < n, p = NextPrime[p], If[smooth3Q[n - p], Return[p]]]; 0];
%t A081309 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Oct 14 2021 *)
%o A081309 (Haskell)
%o A081309 a081309 n | null ps   = 0
%o A081309           | otherwise = head ps
%o A081309           where ps = [p | p <- takeWhile (< n) a000040_list,
%o A081309                           a065333 (n - p) == 1]
%o A081309 -- _Reinhard Zumkeller_, Jul 04 2012
%Y A081309 Cf. A081310, A081311, A081308, A000040, A003586.
%Y A081309 Cf. A065333.
%K A081309 nonn,look
%O A081309 1,3
%A A081309 _Reinhard Zumkeller_, Mar 17 2003