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: Nick Hobson

Nick Hobson's wiki page.

Nick Hobson has authored 51 sequences. Here are the ten most recent ones:

A371497 Irregular triangle read by rows: n-th row gives congruence classes s such that the n-th prime q is a quadratic residue modulo an odd prime p if and only if p = plus or minus s for some s (mod m), where m = q if q is of the form 4k + 1, else m = 4q.

Original entry on oeis.org

1, 1, 1, 1, 3, 9, 1, 5, 7, 9, 19, 1, 3, 4, 1, 2, 4, 8, 1, 3, 5, 9, 15, 17, 25, 27, 31, 1, 7, 9, 11, 13, 15, 19, 25, 29, 41, 43, 1, 4, 5, 6, 7, 9, 13, 1, 3, 5, 9, 11, 15, 23, 25, 27, 33, 41, 43, 45, 49, 55, 1, 3, 4, 7, 9, 10, 11, 12, 16, 1, 2, 4, 5, 8, 9, 10, 16, 18, 20, 1, 3, 7, 9, 13, 17
Offset: 1

Author

Nick Hobson, Mar 25 2024

Keywords

Comments

If n-th prime q is of the form 4k + 1, then by quadratic reciprocity row n consists of quadratic residues mod q, that are less than 2k; i.e., for q > 3, the first half of the corresponding row in A063987.
The first term in each row is always 1.

Examples

			The 1st prime, 2, not of the form 4k + 1, is a square modulo odd primes p if and only if p = +/- 1 (mod 4*2 = 8).
The 6th prime, 13, of the form 4k + 1, is a square modulo odd primes p if and only if p = +/- 1, +/- 3, or +/- 4 (mod 13).
The irregular triangle T(n,k) begins (q is prime(n)):
 n   q \k 1 2 3 4 5 6 7 8 9 10 11
 1,  2: 1
 2,  3: 1
 3,  5: 1
 4,  7: 1 3 9
 5, 11: 1 5 7 9 19
 6: 13: 1 3 4
 7, 17: 1 2 4 8
 8, 19: 1 3 5 9 15 17 25 27 31
 9, 23: 1 7 9 11 13 15 19 25 29 41 43
10, 29: 1 4 5 6 7 9 13
		

Crossrefs

Programs

  • Python
    from sympy import prime
    def A371497_row(n):
        q = prime(n)
        res = {i*i % q for i in range(1, q//2 + 1)}
        if q % 4 == 1:
            res = {a for a in res if 2*a < q}
        else:
            res = {((a % 4 - 1) * q + a) % (4*q) for a in res}
            res = {a if a < 2*q else 4*q - a for a in res}
        return sorted(res)

A179054 a(n) = (1^k + 2^k + ... + n^k) modulo (n+2), where k is any odd integer greater than or equal to 3.

Original entry on oeis.org

1, 1, 1, 4, 1, 1, 1, 6, 1, 1, 1, 8, 1, 1, 1, 10, 1, 1, 1, 12, 1, 1, 1, 14, 1, 1, 1, 16, 1, 1, 1, 18, 1, 1, 1, 20, 1, 1, 1, 22, 1, 1, 1, 24, 1, 1, 1, 26, 1, 1, 1, 28, 1, 1, 1, 30, 1, 1, 1, 32, 1, 1, 1, 34, 1, 1, 1, 36, 1, 1, 1, 38, 1, 1, 1, 40, 1, 1, 1, 42, 1, 1, 1, 44, 1, 1, 1, 46, 1, 1, 1, 48, 1, 1, 1
Offset: 1

Author

Nick Hobson, Jun 27 2010

Keywords

Examples

			a(4) = (1^3 + 2^3 + 3^3 + 4^3) mod 6 = 100 mod 6 = 4.
		

Programs

  • Magma
    &cat [[1,1,1,2*n]: n in [1..30]]; // Vincenzo Librandi, Dec 05 2016
  • Maple
    seq(op([1,1,1,2*k]),k=2..50); # Robert Israel, Dec 05 2016
  • Mathematica
    f[n_] := Mod[n^2(n + 1)^2/4, n + 2]; Array[f, 100] (* Robert G. Wilson v, Jul 01 2010 *)
    LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {1, 1, 1, 4, 1, 1, 1, 6}, 100] (* Vincenzo Librandi, Dec 05 2016 *)
  • PARI
    s=0; for(n=1, 100, s+=n^3; print(s%(n+2)))
    

Formula

a(n) = 2m+2, if n = 4m for some integer m; a(n) = 1 otherwise.
G.f.: (x+x^2+x^3+4*x^4-x^5-x^6-x^7-2*x^8)/(1-2*x^4+x^8). - Robert Israel, Dec 05 2016

Extensions

Typo in name of sequence corrected and formula added by Nick Hobson, Jun 27 2010
More terms from Robert G. Wilson v, Jul 01 2010

A178629 Numbers k such that A003418(k-1) = lcm(1,2,...,k-1) is congruent to 1 modulo k.

Original entry on oeis.org

2, 11, 29, 787, 15773
Offset: 1

Author

Nick Hobson, May 31 2010

Keywords

Comments

Numbers k such that A158851(k-1) = 1.
k must be prime.
No further terms below 3.8*10^8. - Max Alekseyev, Jun 19 2011

Examples

			For the first nontrivial example: lcm(1,2,3,4,5,6,7,8,9,10) = 2520 and 2520 mod 11 = 1, so 11 is in the sequence.
		

Crossrefs

Cf. A158851.

Programs

  • Mathematica
    fQ[n_] := Mod[ LCM @@ Range[n - 1], n] == 1; k = 2; lst = {}; While[k < 10^6, If[ fQ@k, Print@k; AppendTo[lst, k]]; k++ ]; lst (* Robert G. Wilson v, Jun 02 2010 *)
    Select[Range[2,16000],Mod[LCM@@(Range[#-1]),#]==1&] (* Harvey P. Dale, Oct 01 2024 *)
  • PARI
    { L=1; for(n=2,10^8, if(ispseudoprimepower(n,&p), if(p==n&&L%n==1,print(n)); L*=p); ); } \\ Max Alekseyev, Oct 04 2024

Extensions

Offset changed to 1 by Jinyuan Wang, May 02 2020

A130177 For p = the n-th prime, a(n) = the least prime q greater than p+2 such that (p^2+q^2)/2 - 1 is a square, or a(n) = 0 if there is no such prime.

Original entry on oeis.org

0, 11, 263, 59, 23, 101, 109, 1278886952463697, 151, 193, 79, 269, 277, 311, 0, 179, 83, 83003, 479, 487, 181, 563, 571, 613, 1201, 157, 141509, 739, 773, 479, 6858037981, 907, 1291, 983, 227, 6133, 1109, 1151, 54331, 1201, 431, 307, 1327
Offset: 1

Author

Nick Hobson, May 14 2007

Keywords

Examples

			a(3) = 263 because (5^2+263^2)/2-1 = 186^2.
a(4) = 59 because (7^2+59^2)/2-1 = 42^2.
a(5) = 23 because (11^2+23^2)/2-1 = 18^2.
		

Extensions

Edited by T. D. Noe and Don Reble, May 14 2007

A128373 Irregular triangle read by rows: row n (n>=2) lists positions in the sequence A007318 where n appears.

Original entry on oeis.org

4, 7, 8, 11, 13, 16, 19, 12, 22, 26, 29, 34, 37, 43, 46, 53, 17, 18, 56, 64, 67, 76, 79, 89, 92, 103, 106, 118, 23, 25, 121, 134, 137, 151, 154, 169, 172, 188, 191, 208, 24, 211, 229, 30, 33, 232, 251, 254, 274, 277, 298, 301, 323, 326, 349, 352, 376, 379, 404, 38
Offset: 2

Author

Nick Hobson, Mar 01 2007

Keywords

Examples

			In A007318, the number 2 appears in position 4, so the first row is 4. The number 3 appears in positions 7 and 8 in A007318, so the second row is 7, 8.
The irregular triangle begins:
   4
   7,  8
  11, 13
  16, 19
  12, 22, 26
  29, 34
  37, 43
  46, 53
  ...
		

Crossrefs

A128333 a(0) = 0; for n > 0, a(n) = a(n-1)/2 if that number is an integer and not already in the sequence, otherwise a(n) = 3*a(n-1) + 1.

Original entry on oeis.org

0, 1, 4, 2, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 25, 76, 38, 19, 58, 29, 88, 44, 133, 400, 200, 100, 50, 151, 454, 227, 682, 341, 1024, 512, 256, 128, 64, 32, 97, 292, 146, 73, 220, 110, 55, 166, 83, 250, 125, 376, 188, 94, 47, 142, 71, 214, 107, 322, 161
Offset: 0

Author

Nick Hobson, Feb 27 2007

Keywords

Comments

Other than a(0) = 0, the sequence misses all multiples of 3. Does it eventually hit all positive non-multiples of 3?

Examples

			Consider n = 3. We have a(3) = 2 and try to divide by 2. The result, 1, is certainly an integer, but we cannot use it because 1 is already in the sequence. So we must multiply by 3 and add 1 instead, getting a(4) = 3*2 + 1 = 7.
		

Crossrefs

A128204 a(0) = 0; a(n) = a(n-1) - (2n-1) if that number is positive and not already in the sequence, otherwise a(n) = a(n-1) + (2n-1).

Original entry on oeis.org

0, 1, 4, 9, 2, 11, 22, 35, 20, 3, 22, 43, 66, 41, 14, 43, 12, 45, 10, 47, 8, 49, 6, 51, 98, 147, 96, 149, 94, 37, 96, 157, 220, 155, 88, 19, 90, 17, 92, 15, 94, 13, 96, 181, 268, 179, 270, 177, 82, 179, 80, 181, 78, 183, 76, 185, 74, 187, 72, 189, 70, 191, 68, 193, 320
Offset: 0

Author

Nick Hobson, Feb 19 2007

Keywords

Comments

'Recamán transform' (see A005132) of the odd numbers.

Examples

			Consider n=7. We have a(6)=22 and try to subtract 13, the 7th odd number. The result, 9, is certainly positive, but we cannot use it because 9 is already in the sequence. So we must add 13 instead, getting a(7) = 22 + 13 = 35.
		

Crossrefs

Programs

  • PARI
    A128204(N,s/*=1 to print all terms*/)={my(a=0,u=0);  for( n=1,N, s&print1(a","); u=bitor(u,2^a+=if(a<2*n || bittest(u,a+1-2*n), 2*n-1,1-2*n)));a} \\ M. F. Hasler, Mar 07 2012

A127629 Numbers m such that a divisor, together with its quotient and remainder, are consecutive terms (in that order) in a geometric sequence.

Original entry on oeis.org

9, 28, 34, 58, 65, 75, 110, 126, 132, 201, 205, 217, 224, 246, 254, 258, 294, 344, 384, 399, 436, 498, 502, 513, 516, 520, 579, 657, 680, 690, 730, 786, 810, 866, 880, 978, 979, 1001, 1008, 1028, 1038, 1105, 1128, 1164, 1330, 1332, 1365, 1370, 1374, 1388
Offset: 1

Author

Nick Hobson, Jan 20 2007

Keywords

Comments

The sequence misses the primes.
When m is a term, then m = d*q + r and rBernard Schott, May 15 2020

Examples

			58 is in the sequence because 58 = 9*6 + 4, where 9, 6 and 4 are consecutive terms in a geometric sequence.
For a(4) = 58 with noninteger ratio = 3/2:
     58 | 9          58 | 6
        ------          ------
      4 | 6           4 | 9
For a(16) = 258 with integer ratio = 4:
    258 | 32         258 |  8
        ------           -------
      2 |  8           2 | 32
		

Crossrefs

Disjoint union of A334185 and A334186.
Subsequence: A001093 \ {0, 1, 2} (for remainder = 1).

Programs

  • Mathematica
    mx = 1388; m = Ceiling @ Sqrt[mx]; s={}; Do[r = Select[Divisors[k^2], #Amiram Eldar, Aug 28 2019 *)
  • PARI
    is(n)={for(d=1, n, if((n\d)*(n%d)==d^2, return(1))); return(0)}

A128291 Complement of A118248.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 13, 14, 15, 17, 19, 20, 23, 24, 26, 27, 28, 30, 33, 34, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 69, 71, 72, 73, 74, 77, 79, 80, 81, 82, 83, 84, 85, 86, 89, 91, 92, 94, 95, 96, 97, 98, 100
Offset: 0

Author

Nick Hobson, Feb 24 2007

Keywords

Comments

Also: Numbers whose binary representation is a substring of the concatenation of the binary representation of all smaller nonnegative integers not listed earlier. - M. F. Hasler, Dec 29 2012

Examples

			The first term is 3, smallest integer whose binary representation "11"[2] is a substring of the concatenation of the smaller numbers 0,1,2 ~> concat(0,1,10)="0110".
Next is 5="101"[2], which is a substring of concat(0,1,2="10",4="100") = "0110100". Note that 3, since it occurs earlier, is excluded from the list of numbers which are concatenated. - _M. F. Hasler_, Dec 29 2012
		

Crossrefs

A126038 Index where n first appears in A128333, or -1 if n never appears.

Original entry on oeis.org

0, 1, 3, -1, 2, 15, -1, 4, 17, -1, 14, 6, -1, 11, 182, -1, 16, 8, -1, 21, 13, -1, 5, 145, -1, 18, 10, -1, 181, 23, -1, 349, 41, -1, 7, 147, -1, 178, 20, -1, 12, 346, -1, 183, 25, -1, 144, 56, -1, 188, 30, -1, 9, 149, -1, 48, 180, -1, 22, 317, -1, 141, 348, -1
Offset: 0

Author

Nick Hobson, Feb 28 2007

Keywords

Comments

Positive multiples of 3 never appear in A128333. Does every other number eventually appear there?

Crossrefs

Cf. A128333.