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: Christopher Cormier

Christopher Cormier's wiki page.

Christopher Cormier has authored 10 sequences.

A330279 Numbers k such that x^k == k (mod k + 1) has multiple solutions for 0 <= x < k.

Original entry on oeis.org

27, 51, 65, 69, 75, 111, 123, 129, 147, 153, 171, 175, 185, 189, 195, 207, 231, 237, 243, 245, 267, 275, 279, 285, 291, 303, 309, 315, 321, 343, 363, 365, 369, 387, 395, 405, 411, 417, 425, 429, 435, 441, 447, 489, 495, 505, 507, 519, 531, 555, 567, 573, 591, 597
Offset: 1

Author

Christopher Cormier, Dec 09 2019

Keywords

Comments

All odd numbers have k^k == k (mod k + 1), but only some have other solutions in the least residue system (e.g. 3^27 and 19^27 == 27 (mod 28)).
Odd numbers k such that k and A000010(k+1) are not coprime. - Robert Israel, Jul 30 2023

Examples

			27 is in the list because x^27 == 27 (mod 28) has three solutions: 3, 19, and 27.
		

Crossrefs

Programs

  • Maple
    select(t -> igcd(t,numtheory:-phi(t+1))>1, [seq(i,i=1..1000,2)]); # Robert Israel, Jul 30 2023
  • Mathematica
    ok[k_] := Length[Select[Range[0, k-1], PowerMod[#, k, k + 1] == k &, 2]] > 1; Select[ Range@ 600, ok] (* Giovanni Resta, Dec 10 2019 *)
  • PARI
    isok(k) = sum(i=0, k-1, Mod(i, k+1)^k == k) > 1; \\ Michel Marcus, Dec 10 2019

A307213 Divide the natural numbers into sets of successive sizes 3,4,5,6,7,...,, starting with {1,2,3}. Cycle through each set until you reach a prime; if the prime was the n-th element in its set, jump to the n-th element of the next set.

Original entry on oeis.org

1, 2, 5, 9, 10, 11, 16, 17, 23, 30, 31, 39, 40, 41, 50, 51, 52, 43, 53, 64, 65, 66, 67, 79, 92, 93, 94, 95, 96, 97, 111, 112, 113, 128, 129, 130, 131, 147, 148, 149, 166, 167, 185, 186, 187, 169, 170, 171, 172, 173, 192, 193, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 244, 245, 246, 247, 248, 249, 250, 229
Offset: 1

Author

Christopher Cormier, Mar 28 2019

Keywords

Comments

"Cycle" in the definition, means that if no prime is found, go back to the start of the set.
If a set does not contain a prime, the sequence goes into an infinite loop, but it is conjectured that this does not happen since the sets are of increasing length.
The sets (rather intervals) are I_j = [(j^2 + 3*j - 2)/2, j*(j + 5)/2] =[A034856(j), A095998(j)], for j >= 1. For the number of primes in these intervals see A309121. - Wolfdieter Lang, Jul 13 2019

Examples

			The first set is {1,2,3}. We look at 1 then 2. 2 is prime, and it is the second number in the set. The next set is {4,5,6,7}. So we jump to the second element, 5. 5 is also prime, so we jump to the second element of the next set, {8,9,10,11,12}, which is 9, etc. If we reach the end of a set without reaching a prime, we loop back to the first element, which is the only way for a(n) < a(n-1) to happen.
		

Crossrefs

Programs

Extensions

Edited by N. J. A. Sloane, Jul 13 2019

A307248 a(n) is the number of n X n binary matrices (over the reals) with at least one row and column full of 1's where the row index equals the column index.

Original entry on oeis.org

1, 3, 43, 1959, 322711, 200353563, 480333970243, 4501677356510799, 166000436233279199791, 24177686356348838326758723, 13944023623713892837664882211163, 31901388234430284116488783907815338999, 289909480221693304736013256104154256737093831
Offset: 1

Author

Christopher Cormier, Mar 30 2019

Keywords

Comments

This is the number of trivial solutions in A307232, serving as a lower bound.

Examples

			For n = 3, the simplest solutions are:
  1 1 1   0 1 0   0 0 1
  1 0 0   1 1 1   0 0 1
  1 0 0   0 1 0   1 1 1
but any of the 0's may also be a 1, e.g.:
  1 1 1   0 0 1   1 1 1
  1 1 0   0 1 1   1 1 1
  1 1 0   1 1 1   1 1 1
		

Crossrefs

Cf. A307232.

Formula

a(1) = 1; a(n) = 1 + Sum_{k=1..n-1} binomial(n,k)*(2^(k^2) - a(k)).
Proof: Consider a 1 X 1 matrix. There is 1 solution, so a(1) = 1. Consider a 2 X 2 matrix. There are 2 rows, so there are 2 possibilities. If we have 2 row/column pairs, then we have one solution, a matrix of all 1's, and there are no free positions. If we have only 1 row/column pair, then there is one free position, and there are binomial(2,1) ways to place it. Consider the free position as a 1 X 1 matrix. If this 1 X 1 matrix itself has a row/column pair, then our whole 2 X 2 matrix becomes 1's and we duplicate the case with 2 row/column pairs. Thus there are only 2^(1^2) - a(1) = 1 options for this 1 X 1 free position, a 0. In total there are 1 + 2 = 3 distinct solutions, so a(2) = 3. Consider a 3 X 3 matrix. There are 3 possibilities. If we have 3 row/column pairs, then we have the matrix of all 1's. If we have 2 row/column pairs, then we have one free position. There are binomial(3,1) ways to place it. Again, the only option is 0 or else we duplicate the matrix of all 1's. If we only have 1 row/column pair, then we have four free positions in a 2 X 2 pattern. There are binomial(3,2) ways to place them, and there are 2^(2^2) possible options for the elements. But now, there is more than one choice that leads to duplication. If we choose the 2 X 2 matrix to be all 1's, then the entire 3 X 3 is all 1's and we already considered that. Also, if we choose either of the other 2 solutions to n = 2, then we duplicate the 3 X 3 case with only one free position. So out of all the possibilities for this 2 X 2 matrix of free positions, a(2) = 3 of them lead to duplication. By induction, for an n X n matrix, there are n possibilities for the number of row/column pairs. n row/column pairs is the matrix of all 1's, and then we can consider n-1 pairs, n-2 pairs, ..., 1 pair, which leads to k^2 free positions, k = 1, 2, ..., n-1. Each step adds binomial(n,k)*2^(k^2) possible solutions, but we discount the a(k) solutions that lead to duplicating an earlier case.

A307232 a(n) is the number of n X n {0,1}-matrices (over the reals) that contain no zeros when squared.

Original entry on oeis.org

1, 1, 3, 73, 6003, 2318521, 4132876803
Offset: 0

Author

Christopher Cormier, Mar 29 2019

Keywords

Comments

For every n, there are trivial solutions where an entire row is filled with 1's and an entire column is filled with 1's, and the column index is equal to the row index. This easily follows from the nature of matrix multiplication. Every matrix that has at least one of these row/column pairs along with any other 1's is also a solution because there are no negative numbers involved here. The number of trivial solutions is given by A307248.

Examples

			For n = 2, the a(2) = 3 solutions are
  1 1    0 1    1 1
  1 0    1 1    1 1
		

Crossrefs

A002416 is the total number of possible square binary matrices.
A307248 gives a lower bound.

Programs

  • MATLAB
    %Exhaustively searches all matrices
    %from n = 1 to 5
    result = zeros(1,5);
    for n = 1:5
    for m = 0:2^(n^2)-1
        p = fliplr(dec2bin(m,n^2) - '0');
        M = reshape(p,[n n]);
        D = M^2;
        if(isempty(find(D==0, 1)))
            result(n) = result(n) + 1;
        end
    end
    end
  • Mathematica
    a[n_] := Module[{b, iter, cnt = 0}, iter = Sequence @@ Table[{b[k], 0, 1}, {k, 1, n^2}]; Do[If[FreeQ[MatrixPower[Partition[Array[b, n^2], n], 2], 0], cnt++], iter // Evaluate]; cnt]; a[0] = 1;
    Do[Print[a[n]], {n, 0, 5}] (* Jean-François Alcover, Jun 23 2019 *)

Extensions

a(6) from Giovanni Resta, May 29 2019

A267821 Primes whose base-9 representation is a square in base 10.

Original entry on oeis.org

23, 73, 509, 643, 751, 1093, 1153, 1481, 1783, 2029, 6067, 8011, 8933, 9613, 16061, 24763, 30803, 44203, 64633, 74521, 82723, 88003, 94033, 103171, 106619, 118669, 126541, 133321, 154571, 158293, 163561, 165883, 179821, 197339, 202393, 207643, 225523, 234733, 264083, 268003, 284593, 288661, 324931
Offset: 1

Author

Christopher Cormier, Jan 20 2016

Keywords

Comments

Primes in the sequence A267769.

Examples

			73 in base 9 is 81, and 81 = 9^2 in base 10.
		

Crossrefs

In other bases: A267817 - A267821, A241246, A267490.

Programs

  • Mathematica
    Select[Prime@ Range@ 28000, IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 9] &] (* Michael De Vlieger, Jan 24 2016 *)
  • Python
    from sympy import isprime
    A267821_list = [int(d,9) for d in (str(i**2) for i in range(1,10**6)) if max(d) < '9' and isprime(int(d,9))] # Chai Wah Wu, Feb 22 2016

A267820 Primes whose base-6 representation is a square when read in base 10.

Original entry on oeis.org

17, 89, 409, 449, 577, 953, 7649, 12401, 14593, 23689, 28393, 29033, 30689, 36809, 40153, 46457, 47969, 54577, 56393, 59273, 65033, 72649, 78713, 92033, 98953, 106033, 141353, 146249, 150209, 169657, 176489, 199889, 205433, 221849, 235273, 238481, 245033, 258569, 381841, 394633, 441193, 529273
Offset: 1

Author

Christopher Cormier, Jan 20 2016

Keywords

Comments

Primes in the sequence A267766.

Examples

			17 in base 6 is 25, and 25 = 5^2 in base 10.
		

Crossrefs

In other bases: A267817 - A267821, A241246, A267490.

Programs

  • Mathematica
    Select[Prime@ Range@ 45000, IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 6] &] (* Michael De Vlieger, Jan 24 2016 *)
  • Python
    from sympy import isprime
    A267820_list = [int(d,6) for d in (str(i**2) for i in range(1,10**6)) if max(d) < '6' and isprime(int(d,6))] # Chai Wah Wu, Feb 22 2016

A267819 Primes whose base-5 representation is a square when read in base 10.

Original entry on oeis.org

89, 139, 4801, 6829, 9601, 48661, 305551, 539849, 867001, 3503449, 3527071, 6063839, 13912039, 15933439, 18100351, 18319321, 20366399, 22849121, 26239321, 46724801, 63565049, 78057911, 95802799, 100294871, 102369439, 107474911, 139769449, 141118079, 144829879, 159468079, 161483801
Offset: 1

Author

Christopher Cormier, Jan 20 2016

Keywords

Comments

Primes in the sequence A267765.

Examples

			89 in base 5 is 324, and 324 = 18^2 in base 10.
		

Crossrefs

In other bases: A267817 - A267821, A241246, A267490.

Programs

  • Mathematica
    Select[Prime@ Range[10^6], IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 5] &] (* Michael De Vlieger, Jan 24 2016 *)
  • Python
    from sympy import isprime
    A267819_list = [int(d,5) for d in (str(i**2) for i in range(1,10**6)) if max(d) < '5' and isprime(int(d,5))] # Chai Wah Wu, Feb 22 2016

A267818 Primes whose base-4 representation is a square when read in base 10.

Original entry on oeis.org

673, 1165921, 6228961, 53378329, 128818873, 805379161, 926711449, 1542173569, 2459671993, 8365652929, 14232980953, 26484614209, 30755887321, 31937961241, 37968797689, 78180076129, 80974979329, 97835803129, 168394504129, 314911422913, 410879716321, 529074406681
Offset: 1

Author

Christopher Cormier, Jan 20 2016

Keywords

Comments

Primes in the sequence A267764.

Examples

			673 written in base 4 is 22201, and 22201 in base 10 is 149^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range[10^6], IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 4] &] (* Michael De Vlieger, Jan 24 2016 *)
  • PARI
    is(n, b=4, c=10)=issquare(subst(Pol(digits(n, b)), x, c))
    lista(nn) = forprime(p=2, nn, if (is(p), print1(p, ", "))) \\ Michel Marcus, Jan 24 2016
    
  • Python
    from sympy import isprime
    A267818_list = [int(d,4) for d in (str(i**2) for i in range(1,10**6)) if max(d) < '4' and isprime(int(d,4))] # Chai Wah Wu, Feb 22 2016

Extensions

a(8)-a(22) from Chai Wah Wu, Feb 22 2016

A267419 Number of ways of making change for n cents using coins whose values are the previous terms in the sequence, starting with 1,2 cents.

Original entry on oeis.org

1, 2, 2, 3, 5, 8, 10, 14, 17, 23, 28, 35, 43, 53, 64, 78, 93, 112, 132, 158, 184, 217, 253, 295, 342, 396, 455, 526, 600, 689, 784, 893, 1014, 1150, 1299, 1468, 1651, 1860, 2084, 2339, 2613, 2921, 3257, 3628, 4034, 4482, 4967, 5508, 6087, 6731, 7426, 8188, 9017, 9920, 10898, 11969, 13120, 14382, 15737, 17215
Offset: 1

Author

Christopher Cormier, Jan 14 2016

Keywords

Examples

			For n=4, the coins available are 1,2. There are a(4)=3 ways to make 4 cents with these coins:
4 = 1+1+1+1
4 = 2+1+1
4 = 2+2
Since there are 3 ways, now the available coins are 1,2,3. For n=5, we have:
5 = 1+1+1+1+1
5 = 2+1+1+1
5 = 2+2+1
5 = 3+1+1
5 = 3+2
for 5 ways to make change, so now 1,2,3,5 are available, etc.
		

Crossrefs

Programs

  • Mathematica
    a = {1, 2}; Do[AppendTo[a, Count[IntegerPartitions@ n, w_ /; AllTrue[w, MemberQ[a, #] &]]], {n, 3, 60}]; a (* Michael De Vlieger, Jan 15 2016, Version 10 *)

A267490 Primes whose base-8 representation is a perfect square in base 10.

Original entry on oeis.org

149, 241, 661, 1409, 2593, 3733, 6257, 7793, 15313, 23189, 25601, 26113, 30497, 34337, 44053, 49057, 78577, 92821, 95009, 108529, 115861, 132757, 162257, 178417, 183377, 223381, 235541, 242197, 266261, 327317, 345749, 426389, 525461, 693397, 719893, 729713, 805397, 814081, 903841
Offset: 1

Author

Christopher Cormier, Jan 16 2016

Keywords

Comments

Subsequence of primes in A267768. - M. F. Hasler, Jan 20 2016

Examples

			a(1) = 149 because 149 is 225 in base 8, and 225 is 15^2 in base 10.
		

Crossrefs

For primes which are primes in other bases, see A235265, A235266, A152079, A235461 - A235482, A065720A036952, A065721 - A065727, A235394, A235395, A089971A020449, A089981, A090707 - A091924.

Programs

  • Magma
    [n:n in PrimesUpTo(1000000)| IsSquare(Seqint(Intseq(n,8)))]; // Marius A. Burtea, Jun 30 2019
  • Mathematica
    Select[Prime@ Range[10^5], IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 8] &] (* Michael De Vlieger, Jan 16 2016 *)
  • PARI
    listp(nn) = {forprime(p=1, nn, d = digits(p, 8); pd = Pol(d); if (issquare(subst(pd, x, 10)), print1(p, ", ")););} \\ Michel Marcus, Jan 16 2016
    
  • PARI
    is(n,b=8,c=10)={issquare(subst(Pol(digits(n,b)),x,c))&&isprime(n)} \\ M. F. Hasler, Jan 20 2016
    
  • Python
    from sympy import isprime
    A267490_list = [int(s,8) for s in (str(i**2) for i in range(10**6)) if max(s) < '8' and isprime(int(s,8))] # Chai Wah Wu, Jan 20 2016