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 11-20 of 23 results. Next

A286256 Compound filter: a(n) = P(A046523(n), A046523(2+n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

2, 12, 5, 40, 5, 84, 12, 86, 14, 142, 5, 148, 23, 216, 27, 367, 5, 265, 23, 148, 27, 412, 12, 430, 59, 142, 44, 832, 5, 1860, 23, 698, 61, 826, 27, 856, 23, 412, 27, 1402, 5, 850, 80, 148, 90, 1384, 12, 1759, 40, 265, 27, 607, 23, 1105, 61, 430, 27, 2086, 5, 2140, 80, 2352, 148, 4342, 27, 850, 23, 832, 27, 5080, 5, 2998, 80, 142, 148, 832, 27, 2956, 138, 1426
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Cf. A001359 (gives the positions of 5's), A049002 (of 12's), A115093 (of 23's).

Programs

  • PARI
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286256(n) = (2 + ((A046523(n)+A046523(2+n))^2) - A046523(n) - 3*A046523(2+n))/2;
    for(n=1, 10000, write("b286256.txt", n, " ", A286256(n)));
    
  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a(n): return T(a046523(n), a046523(n + 2)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286256 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ 2 n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ 2 n)))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A046523(n)+A046523(2+n))^2) - A046523(n) - 3*A046523(2+n)).

A237367 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that 2*k - 1, prime(k)^2 - 2 and prime(m)^2 - 2 are all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 07 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 73, 81, 534.
(ii) Any integer n > 2 can be written as k + m with k > 0 and m > 0 such that 2*k - 1, prime(k) + k*(k-1) and prime(m) + m*(m-1) are all prime.
(iii) Every n = 9, 10, ... can be written as k + m with k > 0 and m > 0 such that 6*k - 1, prime(k) + 2*k and prime(m) + 2*m are all prime.
Clearly, part (i) of this conjecture implies that there are infinitely many primes p with p^2 - 2 also prime. Similar comments apply to parts (ii) and (iii).

Examples

			a(3) = 1 since 3 = 2 + 1 with 2*2 - 1 = 3, prime(2)^2 - 2 = 3^2 - 2 = 7 and prime(1)^2 - 2 = 2^2 - 2 = 2 all prime.
a(73) = 1 since 73 = 55 + 18 with 2*55 - 1 = 109, prime(55)^2 - 2 = 257^2 - 2 = 66047 and prime(18)^2 - 2 = 61^2 - 2 = 3719 all prime.
a(81) = 1 since 81 = 34 + 47 with 2*34 - 1 = 67, prime(34)^2 - 2 = 139^2 - 2 = 19319 and prime(47)^2 - 2 = 211^2 - 2 = 44519 all prime.
a(534) = 1 since 534 = 100 + 434 with 2*100 - 1 = 199, prime(100)^2 - 2 = 541^2 - 2 = 292679 and prime(434)^2 - 2 = 3023^2 - 2 = 9138527 all prime.
		

Crossrefs

Programs

  • Mathematica
    pq[k_]:=PrimeQ[Prime[k]^2-2]
    a[n_]:=Sum[If[PrimeQ[2k-1]&&pq[k]&&pq[n-k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A237414 Primes p with p^2 - 2 and prime(p)^2 - 2 both prime.

Original entry on oeis.org

2, 3, 43, 47, 107, 139, 191, 211, 223, 239, 293, 313, 337, 541, 743, 757, 863, 1013, 1153, 1231, 1619, 2113, 2137, 2287, 2297, 2423, 2543, 2729, 2749, 2897, 3079, 3089, 3313, 3863, 3947, 4241, 4271, 4583, 4649, 4993, 5581, 6571, 6637, 6911, 7547, 8629, 8849, 8867, 9049, 9661
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 07 2014

Keywords

Comments

According to the conjecture in A237413, this sequence should have infinitely many terms.

Examples

			a(1) = 2 since 2^2 - 2 = 2 and prime(2)^2 - 2 = 3^2 - 2 = 7 are both prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[n^2-2]
    n=0;Do[If[p[Prime[k]]&&p[Prime[Prime[k]]],n=n+1;Print[n," ",Prime[k]]],{k,1,1000}]
    Select[Prime[Range[1200]],AllTrue[{#^2-2,Prime[#]^2-2},PrimeQ]&] (* Harvey P. Dale, Apr 06 2022 *)

A253257 Least positive integer k such that prime(k*n) has the form p^2 - 2 with p prime, or 0 if no such k exists.

Original entry on oeis.org

1, 2, 3, 1, 3, 12, 47, 9, 1, 100, 502, 6, 3, 1817, 1, 362, 3141, 4, 104, 50, 14157, 251, 222, 3, 27, 76, 25, 5423, 416, 73, 28764, 181, 488, 3860, 1249, 2, 138, 52, 1, 25, 8734, 65719, 7089, 214, 15, 111, 7, 990, 6254, 20, 1047, 38, 367, 880, 435, 3712, 3287, 208, 5194, 598
Offset: 1

Views

Author

Zhi-Wei Sun, Jul 05 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
This is stronger than the conjecture that there are infinitely many primes of the form p^2-2 with p prime.
I also conjecture that for any positive integer n there is a positive integer k such that prime(k*n) has the form 2*p^2-1 (or 4*p^2+1, or p^2+p+1) with p prime.

Examples

			a(1) = 1 since prime(1*1) = 2 = 2^2-2 with 2 prime.
a(6) = 12 since prime(12*6) = 359 = 19^2-2 with 19 prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]&&PrimeQ[Sqrt[n]]
    Do[k=0;Label[bb];k=k+1;If[SQ[Prime[k*n]+2],Goto[aa],Goto[bb]];Label[aa];Print[n, " ", k];Continue,{n,1,60}]
  • Perl
    use ntheory ":all"; use Math::Prime::Util::PrimeArray qw/$probj/; my %v; forprimes { undef $v{$*$-2} } 4e7; for my $n (1..800) { my $k=1; $k++ until exists $v{$probj->FETCH($k*$n-1)}; say "$n $k"; } # Dana Jacobsen, Dec 15 2015

A267944 Primes that are a prime power minus two.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 29, 41, 47, 59, 71, 79, 101, 107, 137, 149, 167, 179, 191, 197, 227, 239, 241, 269, 281, 311, 347, 359, 419, 431, 461, 521, 569, 599, 617, 641, 659, 727, 809, 821, 827, 839, 857, 881
Offset: 1

Views

Author

Robert C. Lyons, Jan 22 2016

Keywords

Comments

The sequence is probably infinite, since it includes all the terms of A001359 (Lesser of twin primes).
Also includes A049002. The generalized Bunyakovsky conjecture implies that for every k there are infinitely many terms of the form p^k - 2. - Robert Israel, Jan 22 2016

Examples

			2 is in the sequence because 2 = 2^2 - 2.
3 is in the sequence because 3 = 5^1 - 2.
5 is in the sequence because 5 = 7^1 - 2.
7 is in the sequence because 7 = 3^2 - 2.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and nops(numtheory:-factorset(t+2))=1, [2, seq(i,i=3..1000, 2)]); # Robert Israel, Jan 22 2016
  • Mathematica
    A267944Q = PrimeQ@# && Length@FactorInteger[# + 2] == 1 & (* JungHwan Min, Jan 24 2016 *)
    Select[Array[Prime, 100], Length@FactorInteger[# + 2] == 1 &] (* JungHwan Min, Jan 24 2016 *)
    Select[Prime[Range[300]],PrimePowerQ[#+2]&] (* Harvey P. Dale, Nov 28 2016 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprimepower(p+2), print1(p, ", ")););} \\ Michel Marcus, Jan 22 2016
  • Sage
    [n - 2 for n in prime_powers(1, 1000) if is_prime(n - 2)]
    

A347194 Numbers such that the two adjacent integers are a prime and the square of another prime.

Original entry on oeis.org

8, 10, 24, 48, 168, 360, 840, 1368, 1848, 2208, 3720, 5040, 7920, 10608, 11448, 16128, 17160, 19320, 29928, 36480, 44520, 49728, 54288, 57120, 66048, 85848, 97968, 113568, 128880, 177240, 196248, 201600, 218088, 241080, 273528, 292680, 323760, 344568, 368448, 426408, 458328, 516960, 528528, 537288, 552048, 564000, 573048, 579120
Offset: 1

Views

Author

Bernard Schott, Sep 23 2021

Keywords

Comments

-> Equivalently, numbers k such that tau(k^2-1) = A347191(k) = 6 (see example; used for Maple code).
Proof: tau(k^2-1) = 6 <==> k^2-1 = p^5 or k^2-1 = p*q^2 with p <> q primes; but k^2-p^5 = 1 is impossible, as a consequence of the Catalan-Mihăilescu theorem; now, (k-1)*(k+1) = p*q^2 ==> (k-1 = p and k+1 = q^2) or (k-1 = q^2 and k+1 = p), because k-1 = q and k+1 = p*q is not possible, otherwise 2 = q*(p-1), which would contradict p <> q.
-> There are two possible configurations with p, q primes: (q^2 < a(n) < p) or (p < a(n) < q^2).
The unique configuration q^2 < a(n) < p is for q = 3, a(2) = 10 and p = 11.
All the other configurations, for n = 1 or n >= 3, are of the form p < a(n) < q^2 with p = A049002(n) and q = A062326(n).
-> Note that there is only one integer such that the two adjacent integers are a prime and the square of that prime: it is 3, which lies between 2 and 2^2; in this case, tau(3^2-1) = 4.

Examples

			8 is a term since 8 lies between 7 (prime) and 9 = 3^2 (square of prime); also tau(8^2-1) = tau(63) = 6.
10 is a term since 10 lies between 9 = 3^2 (square of prime) and 11 (prime); also tau(10^2-1) = tau(99) = 6.
24 is a term since 24 lies between 23 (prime) and 25 = 5^2 (square of prime); also tau(24^2-1) = tau(575) = 6.
		

Crossrefs

Subsequence of A163492 (between prime and a perfect square).

Programs

  • Maple
    with(numtheory):
    filter := q-> tau(q^2-1) = 6 : select(filter, [$2..580000]);
  • Mathematica
    q[n_] := Module[{e1 = FactorInteger[n - 1][[;; , 2]], e2 = FactorInteger[n + 1][[;; , 2]]}, (e1 == {1} && e2 == {2}) || (e1 == {2} && e2 == {1})]; Select[Range[4, 600000], q] (* Amiram Eldar, Sep 23 2021 *)
  • PARI
    isok(m) = my(pa, pb); (isprimepower(m-1, &pa)*isprimepower(m+1, &pb) == 2) && (pa != pb); \\ Michel Marcus, Sep 23 2021
    
  • PARI
    upto(n) = { my(res = List()); forprime(i = 3, sqrtint(n-1), if(isprime(i^2 - 2), listput(res, i^2-1); ); if(isprime(i^2 + 2), listput(res, i^2 + 1); ) ); res } \\ David A. Corneth, Sep 23 2021

Formula

For n >= 3: a(n) = A049002(n) + 1 = a(n) = A146981(n) - 1 = (A049002(n) + A146981(n))/2 = A062326(n)^2 - 1.

A065017 Primes of the form p*q + p + q, where (p, q=p+2) are twin primes.

Original entry on oeis.org

23, 47, 167, 359, 1847, 3719, 10607, 19319, 97967, 177239, 273527, 657719, 1042439, 1104599, 1329407, 1515359, 1745039, 2042039, 4464767, 5013119, 5148359, 9740639, 11095559, 11377127, 12538679, 16024007, 16410599, 16752647
Offset: 1

Views

Author

Stephan Wagler (stephanwagler(AT)aol.com), Nov 01 2001

Keywords

Comments

The resulting prime can never be a twin prime since the odd number preceding it is divisible by three and the following odd number is a perfect square.

Examples

			(3*5) + (3+5) = 23.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[ {k = n + 1}, While[ !PrimeQ[k], k++ ]; Return[k]]; k = 1; Do[k = NextPrim[k]; If[ PrimeQ[k + 2], p = k*(k + 2) + 2k + 2; If[ PrimeQ[p], Print[p]]], {n, 1, 700} ]
    f[n_]:=Module[{x=Total[n]+Times@@n},If[PrimeQ[x],x,0]]; Select[f/@ (Select[Partition[Prime[Range[700]],2,1],Last[#]-First[#]==2&]), #!=0&] (* Harvey P. Dale, May 11 2011 *)
  • PARI
    { n=p=0; for (m=1, 10^9, p=nextprime(p + 1); if (isprime(q=p + 2) && isprime(a=p*q + p + q), write("b065017.txt", n++, " ", a); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 03 2009

Formula

p^2 + 4*p + 2.

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Oct 03 2009

A146981 Numbers k of the form q^2, q = prime, such that k-2 is a prime.

Original entry on oeis.org

4, 9, 25, 49, 169, 361, 841, 1369, 1849, 2209, 3721, 5041, 7921, 10609, 11449, 16129, 17161, 19321, 29929, 36481, 44521, 49729, 54289, 57121, 66049, 85849, 97969, 113569, 128881, 177241, 196249, 201601, 218089, 241081, 273529, 292681, 323761
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 04 2008

Keywords

Comments

Except for initial term, a(n) - 1 is not a squarefree number.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[150]]^2,PrimeQ[#-2]&] (* Harvey P. Dale, Jan 15 2020 *)

Formula

a(n) = A049002(n) + 2.
a(n) = A062326(n)^2. - Amiram Eldar, Oct 21 2019

Extensions

Corrected (3721 inserted, 10321 replaced by 19321, 49729 and 218089 inserted) by R. J. Mathar, Apr 22 2010

A226977 Places n where A225867(n) <= 2.

Original entry on oeis.org

7, 8, 11, 17, 23, 29, 41, 47, 59, 71, 239, 359, 419, 839
Offset: 1

Views

Author

Vladimir Shevelev, Jun 27 2013

Keywords

Comments

Except for a(2)=8, all terms are prime.
Is this sequence finite?
There are no other terms up to 86000. - Peter J. C. Moses, Jun 28 2013
There are no more terms up to 10^9. - Charles R Greathouse IV, Nov 25 2014

Crossrefs

Programs

  • PARI
    is(n)=for(k=2,n\2-1,if(sumdiv(n+k,d,(n+d)%k==0 && d>1)>2, return(0))); n>6 \\ Charles R Greathouse IV, Nov 25 2014

A381330 Numbers that are the sum of a prime and the square of a prime in more than one way.

Original entry on oeis.org

11, 27, 28, 32, 38, 51, 52, 54, 56, 62, 66, 68, 72, 78, 80, 86, 92, 96, 98, 108, 110, 116, 122, 126, 128, 132, 134, 138, 140, 146, 150, 152, 156, 158, 162, 164, 171, 172, 174, 176, 180, 182, 186, 188, 192, 198, 200, 204, 206, 210, 212, 216, 218, 222, 224, 228
Offset: 1

Views

Author

Chai Wah Wu, Feb 20 2025

Keywords

Comments

Subsequence of A081053. Most terms are even. The odd terms are 11, 27, 51, 171, 363, 843, 1371, 1851 and must be of the form 2+p^2=4+q for primes p, q. In particular, the odd terms are exactly A049002(n)+4 for n>1.

Examples

			11 is a term since 11 = 2^2+7  = 3^2+2.
27 is a term since 27 = 2^2+23 = 5^2+2.
28 is a term since 28 = 3^2+19 = 5^2+3.
32 is a term since 32 = 3^2+23 = 5^2+7.
		

Crossrefs

Programs

  • PARI
    isok(k) = my(nb=0); forprime(p=2, sqrtint(k), if (isprime(k-p^2), nb++);); nb > 1; \\ Michel Marcus, Feb 21 2025
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy import isprime, primerange
    def A381330_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            c = 0
            for p in primerange(isqrt(n)+1):
                if isprime(n-p**2):
                    c += 1
                if c>1:
                    yield n
                    break
    A381330_list = list(islice(A381330_gen(),30))
    
Previous Showing 11-20 of 23 results. Next