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: Karsten Meyer

Karsten Meyer's wiki page.

Karsten Meyer has authored 11 sequences. Here are the ten most recent ones:

A200525 Zeisel numbers with p(0)=4.

Original entry on oeis.org

385, 2585, 7315, 8911, 27001, 39905, 48391, 87283, 192211, 196285, 319705, 410089, 425585, 441091, 624605, 679855, 1310185, 1899163, 2460439, 2586971, 2777041, 6654005, 7042411, 7501261, 8291459, 9516637, 10484585, 11141671, 12527281, 13015891, 13788319
Offset: 1

Author

Karsten Meyer, Nov 18 2011

Keywords

Comments

Pick any integers A and B and consider the linear recurrence relation given by p(0) = 4, p(i + 1) = A*p(i) + B. If for some n > 2, p(1), p(2), ..., p(n) are distinct primes, then the product of these primes is called a Zeisel number.

Examples

			a=2, b=-3 => p(1) = (4*2)+(-3) = 5; p(2) = (5*2)+(-3) = (7); p(3) = (7*2)+(-3) = 11 => 5*7*11 = 385.
a=2, b=5 => p(1) = (4*2)+5 = 13; p(2) = (13*2)+5 = 31; p(3) = (31*2)+5 = 67 => 13*31*67 = 27001.
		

Crossrefs

Cf. A051015.

Programs

  • Rexx
    n0=4
    do m=1 to 53
      a=2*m
      do b=(1-(4*a)) to 999
        n1=(n0*a)+b
        n2=(n1*a)+b
        n3=(n2*a)+b
        z=n1*n2*n3
        say n0 a b
        lineout("zeisel_4.txt",z||" = "||n1||"*"||n2||"*"||n3||"      "||a||" "||b||" n0="||n0)
        end
      end

A191864 a(n) = (a(n-1) + a(n-4)) * (a(n-2) - a(n-3)) with a(1)=1, a(2)=2, a(3)=3 and a(4)=4.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 10, 28, 99, 1908, 136178, 246396654, 33083692025310, 8147205746460109635768, 269537638338486762080764802762484576, 2195978587041305889551144566841383797948181151148527903340
Offset: 1

Author

Karsten Meyer, Jun 18 2011

Keywords

Examples

			a(5) = (4+1)*(3-2) = 5 ; a(6) = (5+2)*(4-3) = 7
		

Programs

  • Mathematica
    RecurrenceTable[{a[1]==1,a[2]==2,a[3]==3,a[4]==4,a[n]==(a[n-1]+ a[n-4])(a[n-2]- a[n-3])},a,{n,20}] (* Harvey P. Dale, Mar 08 2020 *)
  • PARI
    a=vector(20,i,i);for(n=6,#a,a[n]=(a[n-1]+a[n-4])*(a[n-2]-a[n-3]));a \\ Charles R Greathouse IV, Jun 21 2011

Formula

a(n) = (a(n-1) + a(n-4)) * (a(n-2) - a(n-3)) with a(1)=1, a(2)=2, a(3)=3 and a(4)=4
a(n) = k^(phi^n + o(1)) with k = 1.06164666362... and phi = (1+sqrt(5))/2. [Charles R Greathouse IV, Jun 21 2011]

A178958 Numbers n from A181780 that are not in A181781.

Original entry on oeis.org

15, 28, 35, 39, 51, 52, 55, 63, 66, 70, 75, 76, 87, 95, 99, 111, 112, 115, 119, 123, 124, 130, 135, 143, 147, 148, 154, 155, 159, 171, 172, 176, 183, 186, 187, 190, 195, 196, 203, 207, 208, 215, 219, 232, 235, 238, 244, 246, 255, 267, 268, 275, 276, 279, 280, 286, 287, 291, 292, 295, 299
Offset: 1

Author

Karsten Meyer, Dec 31 2010

Keywords

Comments

Numbers that are Fermat pseudoprimes to some base a (2<=a<=n-2) not Euler pseudoprimes to any base a (2<=a<=n-2).

Examples

			4^(15-1) == 1 (mod 15), but 4^((15-1)/2) == 4 (mod 15)
		

Crossrefs

Programs

  • PARI
    fsp(n)=
    { /* whether n is Fermat pseudoprime to any base a where 2<=a<=n-2 */
        for (a=2,n-2,
            if ( gcd(a,n)!=1, next() );
            if ( (Mod(a,n))^(n-1)==+1, return(1) )
        );
        return(0);
    }
    esp(n)=
    { /* whether n is Euler pseudoprime to any base a where 2<=a<=n-2 */
        local(w);
        if ( n%2==0, return(0) );
        for (a=2,n-2,
            if ( gcd(a,n)!=1, next() );
            w = abs(component((Mod(a,n))^((n-1)/2),2));
            if ( (w==1) || (w==n-1), return(1) )
        );
        return(0);
    }
    for(n=3,300, if(isprime(n),next()); if( fsp(n) && (!esp(n)) , print1(n,", ") ); );

A178705 Odd composite numbers q such that there exists a, 2<=a<=q-2, such that a^d == 1 mod q where d = A000265(q-1). Thus q is a strong pseudoprime in base a.

Original entry on oeis.org

49, 91, 121, 133, 169, 175, 217, 231, 247, 259, 301, 325, 341, 343, 361, 385, 403, 427, 435, 451, 469, 475, 481, 511, 529, 553, 559, 561, 589, 595, 637, 645, 651, 671, 679, 703, 715, 721, 763, 775, 781, 793, 805, 817, 841, 847, 861, 871, 889, 891, 925, 931, 949, 961, 973, 1001, 1015, 1027, 1035, 1045
Offset: 1

Author

Karsten Meyer, Dec 26 2010

Keywords

Comments

Odd composite numbers q such that gcd(A000010(q), A000265(q-1)) > 1. - Robert Israel, Dec 20 2017

Examples

			18^3 == 1 mod 49
		

Crossrefs

Programs

  • Maple
    filter:= proc(n)
      if isprime(n) then return false fi;
      igcd((n-1)/2^padic:-ordp(n-1,2), numtheory:-phi(n)) > 1
    end proc:
    select(filter, [seq(i,i=9..2000,2)]); # Robert Israel, Dec 20 2017
  • Mathematica
    filterQ[n_] := If[PrimeQ[n], False, GCD[(n-1)/2^IntegerExponent[n-1, 2], EulerPhi[n]] > 1];
    Select[Range[9, 2000, 2], filterQ] (* Jean-François Alcover, Sep 25 2020, after Robert Israel *)

Formula

a^d == 1 mod q

Extensions

Corrected by Robert Israel, Dec 20 2017

A178530 Numbers k with the property that there exist nonnegative integers a and b such that k = concat(a,b) = a^2+b^2.

Original entry on oeis.org

0, 1, 100, 101, 1233, 8833, 10100, 990100, 5882353, 94122353, 1765038125, 2584043776, 7416043776, 8235038125, 116788321168, 123288328768, 876712328768, 883212321168, 7681802663025, 8896802846976, 13793103448276, 15348303604525, 84651703604525, 86206903448276, 91103202846976, 92318202663025, 106058810243728
Offset: 1

Author

Karsten Meyer, Dec 23 2010

Keywords

Comments

The sum of two numbers a1 and a2 that share a common b has the form of 10^j. Example: 12 + 88 = 100
The ordered pair of the final digit of a and b is always one of (0,0), (0,1), (0,5), (0,6), (2,3), (8,3), (2,8), or (8,8).
If b has k decimal digits, then (2a - 10^k)^2 + (2b - 1)^2 = 10^(2k) + 1 giving a way for efficient computation of many terms. - Max Alekseyev, Aug 17 2013

Examples

			0 = 0^2+0^2 [this seems a bit far-fetched. - _N. J. A. Sloane_, Dec 23 2010]
1=0^2+1^2 [ditto]
100=10^2+0^2.
101=10^2+1^2.
1233=12^2+33^2.
		

Crossrefs

See A055616, A064942, A101311 for closely related sequences.

Programs

  • Mathematica
    Sort[Reap[Do[n=a^2+b^2; If[n==FromDigits[Join[IntegerDigits[a], IntegerDigits[b]]], Sow[n]], {a,0, 1000}, {b, 0, 1000}]][[2, 1]]]

Extensions

Edited by N. J. A. Sloane, Dec 23 2010
a(11)-a(14) from Nathaniel Johnston, Jan 03 2011
Terms a(15) onward from Max Alekseyev, Aug 17 2013

A181782 Odd composite numbers n that are strong pseudoprimes to some base a, 2 <= a <= n-2.

Original entry on oeis.org

25, 49, 65, 85, 91, 121, 125, 133, 145, 169, 175, 185, 205, 217, 221, 231, 247, 259, 265, 289, 301, 305, 325, 341, 343, 361, 365, 377, 385, 403, 425, 427, 435, 445, 451, 469, 475, 481, 485, 493, 505, 511, 529, 533, 545, 553, 559, 561, 565, 589, 595, 625, 629, 637, 645, 651, 671, 679, 685, 689, 697
Offset: 1

Author

Karsten Meyer, Nov 10 2010

Keywords

Examples

			49 is a strong pseudoprime to the bases 18, 19, 30 and 31, so 49 is in the sequence.
		

Crossrefs

Cf. A141768.

Programs

  • PARI
    /* function sppq() from http://www.jjj.de/pari/rabinmiller.gpi */
    sppq(n,a)=
    { /* Return whether n is a strong pseudoprime to base a (Rabin Miller) */
        local(q, t, b, e);
        q = n-1;  t = 0;  while ( 0==bitand(q,1), q\=2; t+=1 );
        /* here  n==2^t*q+1 */
        b = Mod(a, n)^q;
        if ( 1==b, return(1) );
        e = 1;
        while ( eJoerg Arndt, Dec 27 2010 */
    
  • PARI
    select( is_A181782(n)={bittest(n,0) && !isprime(n) && for(a=2,n-2, my(t=valuation(n-1,2), b=Mod(a,n)^(n>>t)); b==1&&return(1); while(t-->0 && b!=-1 && b!=1, b=b^2); b==-1&&return(1))}, [1..700]) \\ Defines is_A181782(): select(...) gives a check and illustration for free. Inside the for loop is the exact equivalent of the sppq() function above. - M. F. Hasler, Nov 26 2018

Extensions

Definition corrected by Max Alekseyev, Nov 12 2010
Terms corrected by Joerg Arndt, Dec 27 2010

A181781 Numbers n that are Euler pseudoprimes to some base b, 2 <= b <= n-2.

Original entry on oeis.org

21, 25, 33, 45, 49, 57, 65, 69, 77, 85, 91, 93, 105, 117, 121, 125, 129, 133, 141, 145, 153, 161, 165, 169, 175, 177, 185, 189, 201, 205, 209, 213, 217, 221, 225, 231, 237, 245, 247, 249, 253, 259, 261, 265, 273, 285, 289, 297, 301, 305, 309, 321, 325, 329, 333, 341, 343, 345
Offset: 1

Author

Karsten Meyer, Nov 12 2010

Keywords

Crossrefs

Programs

  • Maple
    isEulPSP := proc(n,b) if isprime(n) then false; else m := modp(b &^ ((n-1)/2),n) ; if m= 1 or m = n-1 then true; else false; end if; end if;end proc:
    isA181781 := proc(n) for b from 2 to n-2 do if isEulPSP(n,b) then return true; end if; end do: return false;end proc:
    for n from 3 to 800 do if isA181781(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, May 30 2011
  • Mathematica
    fQ[n_?PrimeQ, b_] = False; fQ[n_, b_] := Block[{p = PowerMod[b, (n - 1)/2, n]}, p == Mod[1, n] || p == Mod[-1, n]]; gQ[n_] := AnyTrue[Range[2, n - 2], fQ[n, #] &]; Select[2 Range[172] + 1, gQ] (* Michael De Vlieger, Sep 09 2015, after Jean-François Alcover at A006970, Version 10 *)

Extensions

Definition corrected by Max Alekseyev, Nov 12 2010
Edited definition to be consistent with OEIS style. - N. J. A. Sloane, Nov 13 2010

A181780 Numbers n which are Fermat pseudoprimes to some base b, 2 <= b <= n-2.

Original entry on oeis.org

15, 21, 25, 28, 33, 35, 39, 45, 49, 51, 52, 55, 57, 63, 65, 66, 69, 70, 75, 76, 77, 85, 87, 91, 93, 95, 99, 105, 111, 112, 115, 117, 119, 121, 123, 124, 125, 129, 130, 133, 135, 141, 143, 145, 147, 148, 153, 154, 155, 159, 161, 165, 169, 171, 172, 175, 176
Offset: 1

Author

Karsten Meyer, Nov 12 2010

Keywords

Comments

A nonprime number n is a Fermat pseudoprime to base b if b^(n-1) = 1 (mod n).
It appears that these n are pseudoprimes for an even number of bases. When n is the product of two distinct primes, it appears that there are exactly two such bases x and y with x + y = n. See A211455, A211456, and A211457. - T. D. Noe, Apr 12 2012

Examples

			15 is Fermat pseudoprime to base 4 and 11, so it is a Fermat pseudoprime.
		

Crossrefs

Even terms give A039772. - Thomas Ordowski, Dec 28 2016

Programs

  • Mathematica
    t = {}; Do[s = Select[Range[2, n-2], PowerMod[#, n-1, n] == 1 &]; If[s != {}, AppendTo[t, n]], {n, Select[Range[213], ! PrimeQ[#] &]}]; t (* T. D. Noe, Nov 07 2011 *)
    (* The following program is much faster than the one above. See A227180 for indications of a proof of this assertion. *) Select[Range[213], ! IntegerQ[Log[3, #]] && ! PrimeQ[#] && GCD[# - 1, EulerPhi[#]] > 1 &] (* Emmanuel Vantieghem, Jul 06 2013 *)
  • PARI
    fsp(n)=
    { /* whether n is Fermat pseudoprime to any base a where 2<=a<=n-2 */
        for (a=2,n-2,
            if ( gcd(a,n)!=1, next() );
            if ( (Mod(a,n))^(n-1)==+1, return(1) )
        );
        return(0);
    }
    for(n=3,300, if(isprime(n),next());  if ( fsp(n) , print1(n,", ") ); );
    \\ Joerg Arndt, Jan 08 2011
    
  • PARI
    is(n)=if(isprime(n), return(0)); my(f=factor(n)[,1]); prod(i=1, #f, gcd(f[i]-1, n-1)) > 2 \\ Charles R Greathouse IV, Dec 28 2016
  • Rexx
    See Meyer link.
    

Formula

For any odd a(m), a(m) = A211456(m) + A211457(m). - Thomas Ordowski, Dec 09 2013

Extensions

Used a comment line to give a more explicit definition. - N. J. A. Sloane, Nov 12 2010
Definition corrected by Max Alekseyev, Nov 12 2010

A111305 Composite numbers k such that a^(k-1) == 1 (mod k) only when a == 1 (mod k).

Original entry on oeis.org

4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 56, 58, 60, 62, 64, 68, 72, 74, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 114, 116, 118, 120, 122, 126, 128, 132, 134, 136, 138, 140, 142, 144
Offset: 1

Author

Karsten Meyer, Nov 02 2005

Keywords

Comments

These unCarmichael numbers fail the Fermat primality test as often as possible.
All such numbers are even: for odd n, (-1)^(n-1) = 1.
The even numbers not in this sequence are 2 and A039772.
If c is a Carmichael number, then 2c is in the sequence. Also, the sequence is A209211 without the first two terms. - Emmanuel Vantieghem, Jul 03 2013

Examples

			10 is a term because 3^9 == 3 (mod 10), 7^9 == 7 (mod 10), 9^9 == 9 (mod 10).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[4, 144],Count[Table[PowerMod[b, # - 1, #], {b, 1, # - 1}], 1] == 1 &] (* Geoffrey Critzer, Apr 11 2015 *)
  • PARI
    is(n)=for(a=2,n-1, if(Mod(a,n)^(n-1)==1, return(0))); !isprime(n) \\ Charles R Greathouse IV, Dec 22 2016

Extensions

Edited by Don Reble, May 16 2006

A112540 Numbers m such that (15m-4, 15m-2, 15m+2, 15m+4) is a prime quadruple.

Original entry on oeis.org

1, 7, 13, 55, 99, 125, 139, 217, 231, 377, 629, 867, 1043, 1049, 1071, 1203, 1261, 1295, 1401, 1485, 1687, 2115, 2323, 2919, 3423, 3689, 4199, 4481, 4633, 4815, 5151, 5313, 5403, 5515, 5921, 6523, 6609, 6741, 7323, 7769, 7953, 8147, 9031, 9611, 10485, 11047
Offset: 1

Author

Karsten Meyer, Dec 16 2005

Keywords

Comments

Also (4p + 16)/60 such that (p, p+2, p+6 and p+8) is a prime quadruple for p >= 11. - Michel Lagneau, Jul 02 2012
The density of these four-prime groups is approximately equal to (log x)^-3.45 (but not (log x)^-4). - Xueshi Gao, Jun 01 2014
All of the terms of this sequence are either 1, 7 or 13 modulo 14. - Rodolfo Ruiz-Huidobro, Dec 27 2019
From Eric Snyder, Jun 23 2021: (Start)
Building on the comment of R. Ruiz-Huidobro above, all terms of the sequence are congruent to one of {-1, 0 ,1} (mod 7). The appearance of mod 14 stems from the fact that all entries in this list must be odd. Equivalently, a(n) cannot be +- 2 or +- 3 (mod 7). This can be generalized for all larger primes:
All primes p >= 7 can be expressed as 15k +- q in a least absolute residue system, with q in {2, 4} if k is odd, and q in {1,7} if k is even.
For all primes 15k +- q >= 7, four residues +-r, +-s (mod p) exist such that, if for any p >= 7, [(m == +- r (mod p) or m == +- s (mod p)), and (m != k)], then m is not in this sequence. For the different values of p = 15k +- q, the values of +-r and +-s are as follows:
For p = 15k +- 1 (k even), r = +- 2k, s = +- 4k
For p = 15k +- 2 (k odd), r = +- k, s = +- 2k
For p = 15k + 4 (k odd), r = +- k, s = +- (7k + 2)
For p = 15k - 4 (k odd), r = +- k, s = +- (7k - 2)
For p = 15k + 7 (k even), r = +- (4k + 2), s = +- (8k + 4)
For p = 15k - 7 (k even), r = +- (4k - 2), s = +- (8k - 4)
These can be used to create an Eratosthenes-like sieve for the prime decades. (End)

Examples

			m = 7 yields the quadruple (15*7 - 4 = 101, 15*7 - 2 = 103, 15*7 + 2 = 107, 15*7 + 4 = 109), so 7 is a term of the sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..2*10^4] | IsPrime(15*n-4) and IsPrime(15*n-2) and IsPrime(15*n+2) and IsPrime(15*n+4)]; // Vincenzo Librandi, Dec 28 2015
    
  • Maple
    A112540:=n->`if`(isprime(15*n-4) and isprime(15*n-2) and isprime(15*n+2) and isprime(15*n+4),n,NULL); seq(A112540(n), n=1..20000); # Wesley Ivan Hurt, Jul 26 2014
  • Mathematica
    Select[Range[6610], PrimeQ[15# - 4] && PrimeQ[15# - 2] && PrimeQ[15# + 2] && PrimeQ[15# + 4]&] (* T. D. Noe, Nov 16 2006 *)
  • PARI
    for(n=1, 1e4, if(isprime(15*n-4) && isprime(15*n-2) && isprime(15*n+2) && isprime(15*n+4), print1(n, ", "))) \\ Felix Fröhlich, Jul 26 2014
    
  • Perl
    use ntheory ":all"; say for map { (4*$+16)/60 } sieve_prime_cluster(11,15*10000, 2,6,8); # _Dana Jacobsen, Dec 15 2015
    
  • Python
    from sympy import isprime
    def ok(m): return all(isprime(15*m+k) for k in [-4, -2, 2, 4])
    print(list(filter(ok, range(11111)))) # Michael S. Branicky, Jun 24 2021

Extensions

Corrected by T. D. Noe, Nov 16 2006