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.

User: Geoffrey Marnell

Geoffrey Marnell's wiki page.

Geoffrey Marnell has authored 3 sequences.

A295706 Primes p for which the difference between p^2 and the square of the next prime is both 1 more and 1 less than a prime.

Original entry on oeis.org

7, 17, 23, 37, 47, 59, 83, 89, 107, 113, 127, 131, 149, 163, 173, 257, 353, 433, 439, 457, 467, 521, 563, 761, 773, 839, 881, 953, 1009, 1031, 1213, 1307, 1319, 1321, 1697, 1733, 1759, 1811, 1861, 1871, 1913, 1979, 2153, 2221, 2281, 2287, 2309, 2393, 2593, 2767, 2789
Offset: 1

Author

Geoffrey Marnell, Nov 25 2017

Keywords

Comments

I.e., primes p for which the difference between p^2 and the square of the next prime is the average of a twin prime pair.

Examples

			The primes 7 and 11 are consecutive and their squares are 49 and 121. The difference is 72, and both 71 and 73 are prime.
Likewise, the difference between the square of 563 and the next prime (569) is 6792, and 6791 and 6793 are twin primes.
		

Crossrefs

Cf. A014574 (average of twin prime pairs), A069482 (difference between squares of consecutive primes).

Programs

  • Maple
    N:= 10^4: # to get all terms <= N
    p:= 1: q:= 2: A:= NULL:
    while p < N do
      p:= q; q:= nextprime(p);
      d:= q^2-p^2;
      if isprime(d+1) and isprime(d-1) then A:= A, p fi
    od:
    A; # Robert Israel, Mar 02 2018
  • Mathematica
    For[p = 1, p < 10000, p++,
    a = Prime[p];
    b = Prime[p + 1];
    c = b^2 - a^2;
    d = (c + 1);
    e = (c - 1);
    If[And[PrimeQ[d] == True, PrimeQ[e] == True], Print[a]];
    ]
    (* Second program: *)
    Select[Partition[Prime@ Range@ 300, 2, 1], AllTrue[{# + 1, # - 1}, PrimeQ] &[#2^2 - #1^2] & @@ # &][[All, 1]] (* Michael De Vlieger, Dec 03 2017 *)
  • PARI
    lista(nn) = { my(pp=2); forprime(p=3, nn, my(d=p^2-pp^2); if(isprime(d+1) && isprime(d-1), print1(pp, ", ")); pp=p); } \\ Iain Fox, Dec 03 2017

A295705 The first of a pair of alternate primes the difference between which is twice a prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 43, 61, 67, 73, 79, 83, 97, 101, 103, 107, 127, 157, 163, 191, 193, 197, 223, 227, 229, 271, 277, 307, 311, 347, 349, 353, 359, 373, 379, 383, 433, 439, 443, 457, 461, 499, 509, 607, 613, 617, 619, 641, 643, 659, 673, 677, 719
Offset: 1

Author

Geoffrey Marnell, Nov 25 2017

Keywords

Comments

Symbolically, the sequence is of p = prime(i) where q = (prime(i + 2) - prime(i))/2 and p and q are prime.
An examination of the first 10^9 primes (using Mathematica) shows that the largest value of q is 157 and it occurs just once: where p = 1907251013.
prime(k+1) where A052288(k) is prime. - Robert Israel, Dec 04 2017
Number of terms less than 10^k: 0, 3, 17, 72, 454, 3034, 22222, 174228, ... - Muniru A Asiru, Jan 24 2018

Examples

			{3, 7} represents a pair of alternate primes, their difference is 4 which is twice a prime (2). Likewise, {787, 809}, their difference being twice 11.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([3..10^4], IsPrime);;
    B := List([1..Length(P)-2],i->(P[i+2]-P[i])/2);;
    o := [];; for i in [1..Length(B)] do if IsPrime(B[i]) then Add(o,P[i]); fi; od; o := A295705; # Muniru A Asiru, Jan 24 2018
  • Maple
    P:= select(isprime,[seq(i,i=3..10^4,2)]):
    P[select(t -> isprime((P[t+2]-P[t])/2), [$1..nops(P)-2])]; # Robert Israel, Dec 04 2017
  • Mathematica
    For[p = 1, p < 100000001, p++,
    a = Prime[p];
    b = Prime[p + 2];
    q = (b - a)/2;
    If[PrimeQ[q] == True, Print[a, " ", b, " ", q]];
    ] (* Marnell *)
    Select[Prime[Range[1000]], PrimeQ[(NextPrime[#, 2] - #)/2] &] (* Alonso del Arte, Nov 25 2017 *)
    searchMax = 200; primes = Prime[Range[searchMax + 2]]; halfAlternPrimeDiffs = Table[(primes[[n + 2]] - primes[[n]])/2, {n, searchMax}]; primes[[Select[Range[searchMax], PrimeQ[halfAlternPrimeDiffs[[#]]] &]]] (* Alonso del Arte, Nov 26 2017 *)
    Select[{#1, #2, (#2 - #1)/2} & @@ # & /@ Transpose@ {Take[#, Length@ # - 2], Drop[#, 2]} &@ Prime@ Range@ 130, PrimeQ@ Last@ # &][[All, 1]] (* Michael De Vlieger, Dec 04 2017 *)
    Select[Partition[Prime[Range[200]],3,1],PrimeQ[(#[[3]]-#[[1]])/2]&][[All,1]] (* Harvey P. Dale, Feb 20 2020 *)
  • PARI
    lista(nn) = {precp = 3; precq = 5; forprime(p=7, nn, if (isprime((p-precp)/2), print1(precp, ", ")); precp = precq; precq = p;);} \\ Michel Marcus, Jan 08 2018
    

A284986 Integers k such that k^2 is not a palindrome and the square root of the reverse of k^2 yields an integer with the same number of digits as k that is not the reverse of k.

Original entry on oeis.org

33, 99, 3168, 6501, 20508, 21468, 110922, 219111, 303577, 304877, 1100922, 1109211, 1110922, 1119111, 2191011, 2191111, 3080367, 3140793, 10110922, 11009111, 11009122, 11009221, 11019111, 11091011, 11091022, 11091111, 11091121, 11091122, 11091202, 11091211
Offset: 1

Author

Geoffrey Marnell, Apr 06 2017

Keywords

Comments

Computer-based iteration shows that there are very few integers such that the square root of the reverse of the square of the integer yields an integer with the same number of digits. Between 1 and 100,000 there are just 168. Curiously, 153 of these 168 yield an integer that is the mirror (or reverse) of the starting number. Two examples: 21^2 = 441 and sqrt(144) = 12; 22^2 = 484 and sqrt(484) = 22. Intuition suggests that this mirroring is more likely if the square is a palindrome (as in the second example). But this is not the case. (The square is not a palindrome in 132 of the 153 cases.) The opposite appears to be the true for those integers that do not yield an equi-digit mirror: more cases occur where the square is a palindrome (9) than when it is not (6). The sequence is of those integers that generate neither a palindrome on squaring nor a mirror when the square root is taken of the reverse of the square (up to 10^6).

References

  • G. Marnell, Mathematical Doodlings: Curiosities, Conjectures and Challenges, Burdock Books, 2017, pages 96-102.

Crossrefs

Subsequence of A102859.

Programs

  • Mathematica
    rev[n_] := FromDigits@ Reverse@ IntegerDigits@n; Select[Range[10^5], (r = rev[#^2]) != #^2 && IntegerQ[q = Sqrt[r]] && q != rev[#] && Equal @@ IntegerLength[{q, #}] &] (* Giovanni Resta, Apr 15 2017 *)

Extensions

a(11)-a(30) from Giovanni Resta, Apr 15 2017