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.

Previous Showing 51-60 of 265 results. Next

A095874 a(n) = k if n = A000961(k) (powers of primes), a(n) = 0 if n is not in A000961.

Original entry on oeis.org

1, 2, 3, 4, 5, 0, 6, 7, 8, 0, 9, 0, 10, 0, 0, 11, 12, 0, 13, 0, 0, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 19, 0, 0, 0, 0, 20, 0, 0, 0, 21, 0, 22, 0, 0, 0, 23, 0, 24, 0, 0, 0, 25, 0, 0, 0, 0, 0, 26, 0, 27, 0, 0, 28, 0, 0, 29, 0, 0, 0, 30, 0, 31, 0, 0, 0, 0, 0, 32, 0, 33, 0, 34, 0, 0, 0, 0, 0, 35, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2004

Keywords

Comments

The name has been edited to clarify that the indices k refer to A000961 ("powers of primes" = {1} U A246655) and not to the list A246655 of proper prime powers. - M. F. Hasler, Jun 16 2021

Crossrefs

Cf. A000961 (right inverse), A049084, A097621.

Programs

  • Haskell
    a095874 n | y == n    = length xs + 1
              | otherwise = 0
              where (xs, y:ys) = span (< n) a000961_list
    -- Reinhard Zumkeller, Feb 16 2012, Jun 26 2011
    
  • Mathematica
    Join[{1},Module[{k=2},Table[If[PrimePowerQ[n],k;k++,0],{n,2,100}]]] (* Harvey P. Dale, Aug 15 2020 *)
  • PARI
    a(n)=if(isprimepower(n), sum(i=1,logint(n,2), primepi(sqrtnint(n,i)))+1, n==1) \\ Charles R Greathouse IV, Apr 29 2015
    
  • PARI
    {M95874=Map(); A095874(n,k)=if(mapisdefined(M95874,n,&k),k, isprimepower(n), mapput(M95874,n, k=sum(i=1,exponent(n), primepi(sqrtnint(n,i)))+1); k,n==1)} \\ Variant with memoization, possibly useful to compute A097621, A344826 and related. One may omit "isprimepower(n)," (possibly requiring factorization) and ",n==1" if n is known to be a power of a prime, i.e., to get a left inverse for A000961. - M. F. Hasler, Jun 15 2021
    
  • Python
    from sympy import primepi, integer_nthroot, primefactors
    def A095874(n): return 1+int(primepi(n)+sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length()))) if n==1 or len(primefactors(n))==1 else 0 # Chai Wah Wu, Jan 19 2025

Formula

a(n) = Sum_{1 <= k <= n} A010055(k); [corrected by M. F. Hasler, Jun 15 2021]
a(n) = A065515(n)*(A065515(n)-A065515(n-1)).
a(n) = A065515(n)*A069513(n). - M. F. Hasler, Jun 16 2021

Extensions

Edited by M. F. Hasler, Jun 15 2021

A045616 Primes p such that 10^(p-1) == 1 (mod p^2).

Original entry on oeis.org

3, 487, 56598313
Offset: 1

Views

Author

Helmut Richter, Dec 11 1999

Keywords

Comments

Primes p such that the decimal fraction 1/p has same period length as 1/p^2, i.e., the multiplicative order of 10 modulo p is the same as the multiplicative order of 10 modulo p^2. [extended by Felix Fröhlich, Feb 05 2017]
No further terms below 1.172*10^14 (as of Feb 2020, cf. Fischer's table).
56598313 was announced in the paper by Brillhart et al. - Helmut Richter, May 17 2004
A265012(A049084(a(n))) = 1. - Reinhard Zumkeller, Nov 30 2015
From Jianing Song, Jun 21 2025: (Start)
The ring of integers of Q(10^(1/k)) is Z[10^(1/k)] if and only if k does not have a prime factor in this sequence. See Theorem 5.3 of the paper of Keith Conrad. For example, we have:
(1 + 10^(1/3) + 10^(2/3))/3 is an algebraic integer, but it is not in Z[10^(1/3)];
(1 + 10^(486/487) + 10^(2*486/487) + ... + 10^(486*486/487))/487 is an algebraic integer, but it is not in Z[10^(1/487)];
(1 + 10^(56598312/56598313) + 10^(2*56598312/56598313) + ... + 10^(56598312*56598312/56598313))/56598313 is an algebraic integer, but it is not in Z[10^(1/56598313)]. (End)

References

  • J. Brillhart, J. Tonascia, and P. Weinberger, On the Fermat quotient, pp. 213-222 of A. O. L. Atkin and B. J. Birch, editors, Computers in Number Theory. Academic Press, NY, 1971.
  • Richard K. Guy, Unsolved Problems in Number Theory, Springer, 2004, A3.

Crossrefs

Programs

  • Haskell
    import Math.NumberTheory.Moduli (powerMod)
    a045616 n = a045616_list !! (n-1)
    a045616_list = filter
                   (\p -> powerMod 10 (p - 1) (p ^ 2) == 1) a000040_list'
    -- Reinhard Zumkeller, Nov 30 2015
  • Mathematica
    A045616Q = PrimeQ@# && PowerMod[10, # - 1, #^2] == 1 &; Select[Range[1000000], A045616Q] (* JungHwan Min, Feb 04 2017 *)
    Select[Prime[Range[34*10^5]],PowerMod[10,#-1,#^2]==1&] (* Harvey P. Dale, Apr 10 2018 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (Mod(10, p^2)^(p-1)==1, print1(p, ", "))); \\ Michel Marcus, Aug 16 2015
    

A064553 a(1) = 1, a(prime(i)) = i + 1 for i > 0 and a(u * v) = a(u) * a(v) for u, v > 0.

Original entry on oeis.org

1, 2, 3, 4, 4, 6, 5, 8, 9, 8, 6, 12, 7, 10, 12, 16, 8, 18, 9, 16, 15, 12, 10, 24, 16, 14, 27, 20, 11, 24, 12, 32, 18, 16, 20, 36, 13, 18, 21, 32, 14, 30, 15, 24, 36, 20, 16, 48, 25, 32, 24, 28, 17, 54, 24, 40, 27, 22, 18, 48, 19, 24, 45, 64, 28, 36, 20, 32, 30, 40, 21, 72, 22, 26
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 21 2001

Keywords

Comments

a(n) <= n for all n and a(x) = x iff x = 2^i * 3^j for i, j >= 0: a(A003586(n)) = A003586(n) for n > 0. By definition a is completely multiplicative and also surjective. a(p) < a(q) for primes p < q.
Completely multiplicative with a(prime(i)) = i + 1. - Charles R Greathouse IV, Sep 07 2012
a(A080688(n,k)) = A080444(n,k) = n for k=1..A001055(n). - Reinhard Zumkeller, Oct 01 2012

Examples

			a(5) = a(prime(3)) = 3 + 1 = 4; a(14) = a(2*7) = a(prime(1)* prime(4)) = (1+1)*(4+1) = 10.
		

Crossrefs

Programs

  • Haskell
    a064553 1 = 1
    a064553 n = product $ map ((+ 1) . a049084) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012, Feb 17 2012, Jan 28 2011
    
  • Maple
    A064553 := proc(n)
        local a,f,p,e ;
        a := 1 ;
        for f in ifactors(n)[2] do
            p :=op(1,f) ;
            e :=op(2,f) ;
            a := a*(numtheory[pi](p)+1)^e ;
        end do:
        a ;
    end proc: # R. J. Mathar, Sep 07 2012
  • Mathematica
    nn=100; a=Table[0, {nn}]; a[[1]]=1; Do[If[PrimeQ[i], a[[i]]=PrimePi[i]+1, p=FactorInteger[i][[1,1]]; a[[i]] = a[[p]]*a[[i/p]]], {i, 2, nn}]; a (* T. D. Noe, Dec 12 2004, revised Sep 27 2011 *)
    Array[Apply[Times, Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger[ #]] /. p_ /; PrimeQ@ p :> PrimePi@ p + 1] &, 74] (* Michael De Vlieger, Aug 22 2017 *)
  • PARI
    A064553(n)={n=factor(n);n[,1]=apply(f->1+primepi(f),n[,1]);factorback(n)} \\ M. F. Hasler, Aug 28 2012
    
  • Scheme
    (define (A064553 n) (if (= 1 n) n (* (+ 1 (A055396 n)) (A064553 (A032742 n))))) ;; Antti Karttunen, Aug 22 2017

Formula

a(A000040(n)) = n+1.
Let the prime factorization of n be p1^e1...pk^ek, then a(n) = (pi(p1)+1)^e1...(pi(pk)+1)^ek, where pi(p) is the index of prime p. - T. D. Noe, Dec 12 2004
From Antti Karttunen, Aug 22 2017: (Start)
a(n) = A003963(A003961(n)).
a(A181819(n)) = A000005(n).
a(A290641(n)) = n. (End)

Extensions

Displayed values double-checked with new PARI code by M. F. Hasler, Aug 28 2012

A286469 a(n) = maximum of {the index of least prime dividing n} and {the maximal gap between indices of the successive primes in the prime factorization of n}.

Original entry on oeis.org

0, 1, 2, 1, 3, 1, 4, 1, 2, 2, 5, 1, 6, 3, 2, 1, 7, 1, 8, 2, 2, 4, 9, 1, 3, 5, 2, 3, 10, 1, 11, 1, 3, 6, 3, 1, 12, 7, 4, 2, 13, 2, 14, 4, 2, 8, 15, 1, 4, 2, 5, 5, 16, 1, 3, 3, 6, 9, 17, 1, 18, 10, 2, 1, 3, 3, 19, 6, 7, 2, 20, 1, 21, 11, 2, 7, 4, 4, 22, 2, 2, 12, 23, 2, 4, 13, 8, 4, 24, 1, 4, 8, 9, 14, 5, 1, 25, 3, 3, 2, 26, 5, 27, 5, 2, 15, 28, 1, 29, 2, 10, 3
Offset: 1

Views

Author

Antti Karttunen, May 14 2017

Keywords

Comments

This gives the maximal gap between the indices of successive prime factors p_i <= p_j <= ... <= p_k of n = p_i * p_j * ... * p_k when the index of the least prime factor p_i (A055396) is considered as the initial gap from the "level zero".

Crossrefs

Programs

  • Python
    from sympy import primepi, isprime, primefactors, divisors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def x(n): return 1 if n==1 else divisors(n)[-2]
    def a286470(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a286470(x(n)))
    def a(n): return max(a055396(n), a286470(n)) # Indranil Ghosh, May 17 2017
  • Scheme
    (define (A286469 n) (max (A055396 n) (A286470 n)))
    

Formula

a(n) = max(A055396(n), A286470(n)).
a(n) = A051903(A122111(n)).
For all i, j: A286621(i) = A286621(j) => a(i) = a(j). [Because of the above formula.]

Extensions

Definition corrected May 17 2017

A039709 a(n) = n-th prime modulo 11.

Original entry on oeis.org

2, 3, 5, 7, 0, 2, 6, 8, 1, 7, 9, 4, 8, 10, 3, 9, 4, 6, 1, 5, 7, 2, 6, 1, 9, 2, 4, 8, 10, 3, 6, 10, 5, 7, 6, 8, 3, 9, 2, 8, 3, 5, 4, 6, 10, 1, 2, 3, 7, 9, 2, 8, 10, 9, 4, 10, 5, 7, 2, 6, 8, 7, 10, 3, 5, 9, 1, 7, 6, 8, 1, 7, 4, 10, 5, 9, 4, 1, 5, 2, 1, 3, 2, 4, 10, 3
Offset: 1

Views

Author

Clark Kimberling, Dec 11 1999

Keywords

Crossrefs

Programs

Formula

a(A049084(A137977(n-1))) = even; a(A049084(A137978(n-1))) = odd. - Reinhard Zumkeller, Feb 25 2008
Sum_k={1..n} a(k) ~ (11/2)*n. - Amiram Eldar, Dec 11 2024

A073490 Number of prime gaps in factorization of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 03 2002

Keywords

Comments

A137723(n) is the smallest number of the first occurring set of exactly n consecutive numbers with at least one prime gap in their factorization: a(A137723(n)+k)>0 for 0<=kA137723(n)-1)=a(A137723(n)+n)=0. - Reinhard Zumkeller, Feb 09 2008

Examples

			84 = 2*2*3*7 with one gap between 3 and 7, therefore a(84) = 1;
110 = 2*5*11 with two gaps: between 2 and 5 and between 5 and 11, therefore a(110) = 2.
		

Crossrefs

Programs

  • Haskell
    a073490 1 = 0
    a073490 n = length $ filter (> 1) $ zipWith (-) (tail ips) ips
       where ips = map a049084 $ a027748_row n
    -- Reinhard Zumkeller, Jul 04 2012
    
  • Maple
    A073490 := proc(n)
        local a,plist ;
        plist := sort(convert(numtheory[factorset](n),list)) ;
        a := 0 ;
        for i from 2 to nops(plist) do
            if op(i,plist) <> nextprime(op(i-1,plist)) then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc:
    seq(A073490(n),n=1..110) ; # R. J. Mathar, Oct 27 2019
  • Mathematica
    gaps[n_Integer/;n>0]:=If[n===1, 0, Complement[Prime[PrimePi[Rest[ # ]]-1], # ]&[First/@FactorInteger[n]]]; Table[Length[gaps[n]], {n, 1, 120}] (* Wouter Meeussen, Oct 30 2004 *)
    pa[n_, k_] := If[k == NextPrime[n], 0, 1]; Table[Total[pa @@@ Partition[First /@ FactorInteger[n], 2, 1]], {n, 120}] (* Jayanta Basu, Jul 01 2013 *)
  • Python
    from sympy import primefactors, nextprime
    def a(n):
        pf = primefactors(n)
        return sum(p2 != nextprime(p1) for p1, p2 in zip(pf[:-1], pf[1:]))
    print([a(n) for n in range(1, 121)]) # Michael S. Branicky, Oct 14 2021

Formula

a(n) = A073484(A007947(n)).
a(A000040(n))=0; a(A000961(n))=0; a(A006094(n))=0; a(A002110(n))=0; a(A073485(n))=0.
a(A073486(n))>0; a(A073487(n)) = 1; a(A073488(n))=2; a(A073489(n))=3.
a(n)=0 iff A073483(n) = 1.
a(A097889(n)) = 0. - Reinhard Zumkeller, Nov 20 2004
0 <= a(m*n) <= a(m) + a(n) + 1. A137794(n) = 0^a(n). - Reinhard Zumkeller, Feb 11 2008

Extensions

More terms from Franklin T. Adams-Watters, May 19 2006

A080148 Positions of primes of the form 4*k+3 (A002145) among all primes (A000040).

Original entry on oeis.org

2, 4, 5, 8, 9, 11, 14, 15, 17, 19, 20, 22, 23, 27, 28, 31, 32, 34, 36, 38, 39, 41, 43, 46, 47, 48, 49, 52, 54, 56, 58, 61, 63, 64, 67, 69, 72, 73, 75, 76, 81, 83, 85, 86, 90, 91, 92, 93, 94, 95, 96, 99, 101, 103, 105, 107, 109, 111, 114, 115, 117, 118, 120, 124, 125, 128
Offset: 1

Views

Author

Antti Karttunen, Feb 11 2003

Keywords

Comments

It appears that a(n) = k such that binomial(prime(k),3) mod 2 = 1. See Maple code. - Gary Detlefs, Dec 06 2011
The above is correct (work mod 4). - Charles R Greathouse IV, Dec 06 2011
The asymptotic density of this sequence is 1/2 (by Dirichlet's theorem). - Amiram Eldar, Mar 01 2021

Crossrefs

Almost complement of A080147 (1 is excluded from both).

Programs

Formula

a(n) = A049084(A002145(n)). - R. J. Mathar, Oct 06 2008

A112049 a(n) = position of A112046(n) in A000040.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 4, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 5, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 3, 6, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 4, 3, 1, 1, 2, 2, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

A112051 gives the first positions of distinct new values in this sequence, that seem also to be the positions of the first occurrence of each n, and thus the positions of the records. Compare also to A084921. - Antti Karttunen, May 26 2017

Crossrefs

Cf. A286579 (ordinal transform).

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1},While[JacobiSymbol[i, 2n + 1]==1, i++]; i];a049084[n_]:=If[PrimeQ[n], PrimePi[n], 0]; Table[a049084[a112046[n]], {n, 102}] (* Indranil Ghosh, May 11 2017 *)
  • PARI
    A112049(n) = for(i=1, (2*n), if((kronecker(i, (n+n+1)) < 1), return(primepi(i)))); \\ Antti Karttunen, May 26 2017
    
  • Python
    from sympy import jacobi_symbol as J, isprime, primepi
    def a049084(n):
        return primepi(n) if isprime(n) else 0
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a049084(a112046(n))
    print([a(n) for n in range(1, 103)]) # Indranil Ghosh, May 11 2017

Formula

a(n) = A049084(A112046(n)).

Extensions

Unnecessary fallback-clause removed from the name by Antti Karttunen, May 26 2017

A242378 Square array read by antidiagonals: to obtain A(i,j), replace each prime factor prime(k) in prime factorization of j with prime(k+i).

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 3, 1, 0, 4, 5, 5, 1, 0, 5, 9, 7, 7, 1, 0, 6, 7, 25, 11, 11, 1, 0, 7, 15, 11, 49, 13, 13, 1, 0, 8, 11, 35, 13, 121, 17, 17, 1, 0, 9, 27, 13, 77, 17, 169, 19, 19, 1, 0, 10, 25, 125, 17, 143, 19, 289, 23, 23, 1, 0, 11, 21, 49, 343, 19, 221, 23, 361, 29, 29, 1, 0
Offset: 0

Views

Author

Antti Karttunen, May 12 2014

Keywords

Comments

Each row i is a multiplicative function, being in essence "the i-th power" of A003961, i.e., A(i,j) = A003961^i (j). Zeroth power gives an identity function, A001477, which occurs as the row zero.
The terms in the same column have the same prime signature.
The array is read by antidiagonals: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ... .

Examples

			The top-left corner of the array:
  0,   1,   2,   3,   4,   5,   6,   7,   8, ...
  0,   1,   3,   5,   9,   7,  15,  11,  27, ...
  0,   1,   5,   7,  25,  11,  35,  13, 125, ...
  0,   1,   7,  11,  49,  13,  77,  17, 343, ...
  0,   1,  11,  13, 121,  17, 143,  19,1331, ...
  0,   1,  13,  17, 169,  19, 221,  23,2197, ...
...
A(2,6) = A003961(A003961(6)) = p_{1+2} * p_{2+2} = p_3 * p_4 = 5 * 7 = 35, because 6 = 2*3 = p_1 * p_2.
		

Crossrefs

Taking every second column from column 2 onward gives array A246278 which is a permutation of natural numbers larger than 1.
Transpose: A242379.
Row 0: A001477, Row 1: A003961 (from 1 onward), Row 2: A357852 (from 1 onward), Row 3: A045968 (from 7 onward), Row 4: A045970 (from 11 onward).
Column 2: A000040 (primes), Column 3: A065091 (odd primes), Column 4: A001248 (squares of primes), Column 6: A006094 (products of two successive primes), Column 8: A030078 (cubes of primes).
Excluding column 0, a subtable of A297845.
Permutations whose formulas refer to this array: A122111, A241909, A242415, A242419, A246676, A246678, A246684.

Formula

A(0,j) = j, A(i,0) = 0, A(i > 0, j > 0) = A003961(A(i-1,j)).
For j > 0, A(i,j) = A297845(A000040(i+1),j) = A297845(j,A000040(i+1)). - Peter Munn, Sep 02 2025

A256617 Numbers having exactly two distinct prime factors, which are also adjacent prime numbers.

Original entry on oeis.org

6, 12, 15, 18, 24, 35, 36, 45, 48, 54, 72, 75, 77, 96, 108, 135, 143, 144, 162, 175, 192, 216, 221, 225, 245, 288, 323, 324, 375, 384, 405, 432, 437, 486, 539, 576, 648, 667, 675, 768, 847, 864, 875, 899, 972, 1125, 1147, 1152, 1215, 1225, 1296, 1458, 1517, 1536, 1573, 1715, 1728, 1763, 1859, 1875, 1944
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 05 2015

Keywords

Examples

			.   n | a(n)                      n | a(n)
. ----+------------------       ----+------------------
.   1 |   6 = 2 * 3              13 |  77 = 7 * 11
.   2 |  12 = 2^2 * 3            14 |  96 = 2^5 * 3
.   3 |  15 = 3 * 5              15 | 108 = 2^2 * 3^3
.   4 |  18 = 2 * 3^2            16 | 135 = 3^3 * 5
.   5 |  24 = 2^3 * 3            17 | 143 = 11 * 13
.   6 |  35 = 5 * 7              18 | 144 = 2^4 * 3^2
.   7 |  36 = 2^2 * 3^2          19 | 162 = 2 * 3^4
.   8 |  45 = 3^2 * 5            20 | 175 = 5^2 * 7
.   9 |  48 = 2^4 * 3            21 | 192 = 2^6 * 3
.  10 |  54 = 2 * 3^3            22 | 216 = 2^3 * 3^3
.  11 |  72 = 2^3 * 3^2          23 | 221 = 13 * 17
.  12 |  75 = 3 * 5^2            24 | 225 = 3^2 * 5^2 .
		

Crossrefs

Subsequence of A007774.
Subsequences: A006094, A033845, A033849, A033851.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a256617 n = a256617_list !! (n-1)
    a256617_list = f (singleton (6, 2, 3)) $ tail a000040_list where
       f s ps@(p : ps'@(p':_))
         | m < p * p' = m : f (insert (m * q, q, q')
                              (insert (m * q', q, q') s')) ps
         | otherwise  = f (insert (p * p', p, p') s) ps'
         where ((m, q, q'), s') = deleteFindMin s
    
  • Mathematica
    Select[Range[2000], MatchQ[FactorInteger[#], {{p_, }, {q, }} /; q == NextPrime[p]]&] (* _Jean-François Alcover, Dec 31 2017 *)
  • PARI
    is(n) = if(omega(n)!=2, return(0), my(f=factor(n)[, 1]~); if(f[2]==nextprime(f[1]+1), return(1))); 0 \\ Felix Fröhlich, Dec 31 2017
    
  • PARI
    list(lim)=my(v=List(),c=sqrtnint(lim\=1,3),d=nextprime(c+1),p=2); forprime(q=3,d, for(i=1,logint(lim\q,p), my(t=p^i); while((t*=q)<=lim, listput(v,t))); p=q); forprime(q=d+1,lim\precprime(sqrtint(lim)), listput(v,p*q); p=q); Set(v) \\ Charles R Greathouse IV, Apr 12 2020
    
  • Python
    from sympy import primefactors, nextprime
    A256617_list = []
    for n in range(1,10**5):
        plist = primefactors(n)
        if len(plist) == 2 and plist[1] == nextprime(plist[0]):
            A256617_list.append(n) # Chai Wah Wu, Aug 23 2021

Formula

A001222(a(n)) = 2.
A006530(a(n)) = A151800(A020639(n)) = A000040(A049084(A020639(a(n)))+1).
Sum_{n>=1} 1/a(n) = Sum_{n>=1} 1/A083553(n) = Sum_{n>=1} 1/((prime(n)-1)*(prime(n+1)-1)) = 0.7126073495... - Amiram Eldar, Dec 23 2020
Previous Showing 51-60 of 265 results. Next