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.

A106628 Anomalous prime numbers.

This page as a plain text file.
%I A106628 #16 Aug 23 2025 23:16:07
%S A106628 199,211,283,317,337,389,491,509,547,577,619,683,701,773,787,797,863,
%T A106628 887,1069,1109,1129,1153,1163,1373,1381,1409,1459,1523,1531,1571,1627,
%U A106628 1637,1669,1709,1723,1733,1759,1831,1889,1913,1933,1951,1979,2003,2017
%N A106628 Anomalous prime numbers.
%C A106628 If x and y are two consecutive prime numbers (x < y), Euclid's algorithm gives integers t and d such that tx+dy = 1 = gcd(x, y). The algorithm "Anomalia" gives t and d such that |t+d| is as small as possible (it is often = 1). The prime number x is 'anomalous' iff |t+d| > 1 for x and y.
%C A106628 That is, primes p such that neither q-1 nor q+1 is divisible by q-p, where q is the next prime larger than p. - _Charles R Greathouse IV_, Aug 20 2017
%H A106628 Charles R Greathouse IV, <a href="/A106628/b106628.txt">Table of n, a(n) for n = 1..10000</a>
%F A106628 Conjecture: a(n) ~ n log n. - _Charles R Greathouse IV_, Aug 20 2017
%e A106628 a(1) = 199 because -88*199+83*211 = 1, |-88+83| = 5 > 1;
%e A106628 |tx+dy| = 1 for all primes x < 199 (when t and d are determined by the algorithm "Anomalia")
%t A106628 q[x_]:=Module[{y,d},If[!PrimeQ[x],Return[0]];y=NextPrime[x + 1];d=y-x;Mod[y-1, d]!=0 && Mod[y+1, d] != 0];Select[Range[2017],q] (* _James C. McMahon_, Aug 23 2025 *)
%o A106628 {ALGORITHM "Anomalia" in pseudo language} INPUT x, y {positive integers} m := x, n := y, b := 0, d := 1, p := 1, t := 0 WHILE m <> 0 DO q := n DIV m h := m, m := n-q*m, n := h h := b, b := d-q*b, d := h h := p, p := t-q*p, t := h WRITE - The gcd of the numbers is WRITE n = tx+dy {this is 1 for consecutive primes}
%o A106628 (PARI) is(x)=if(!isprime(x), return(0)); my(y=nextprime(x+1),d=y-x); (y-1)%d && (y+1)%d \\ _Charles R Greathouse IV_, Aug 20 2017
%Y A106628 Subsequence of A083371.
%K A106628 base,nonn,changed
%O A106628 1,1
%A A106628 _Pahikkala Jussi_, May 11 2005