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: Thomas Kerscher

Thomas Kerscher's wiki page.

Thomas Kerscher has authored 9 sequences.

A355854 Numbers of the form (ab+cd)*(ad+bc) with integers a,b,c,d >= 1.

Original entry on oeis.org

4, 9, 16, 20, 25, 35, 36, 49, 54, 56, 60, 64, 77, 80, 81, 91, 99, 100, 104, 108, 110, 121, 128, 135, 136, 140, 143, 144, 154, 156, 169, 170, 171, 176, 180, 182, 187, 189, 195, 196, 209, 216, 220, 221, 224, 225, 240, 250, 252, 256, 260, 266, 270, 272, 275, 286, 289
Offset: 1

Author

Thomas Kerscher, Jul 30 2022

Keywords

Examples

			77 is in the sequence because (1*1+2*5)(1*5+1*2)=77 (for a=1, b=1, c=2, d=5).
		

Crossrefs

Cf. A000290.

Extensions

More terms from David A. Corneth, Jul 30 2022

A332801 a(n) is the number of even results of n mod k, for 1 < k < n.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 1, 4, 3, 5, 3, 7, 3, 9, 5, 8, 6, 11, 5, 13, 7, 13, 7, 15, 8, 16, 10, 16, 10, 20, 8, 21, 11, 21, 13, 22, 12, 24, 14, 24, 14, 28, 12, 30, 16, 28, 16, 30, 17, 32, 18, 32, 18, 36, 18, 36, 20, 36, 20, 40, 18, 42, 22, 39, 25, 41, 23, 43, 25, 45, 23, 48, 22, 50
Offset: 1

Author

Thomas Kerscher, Feb 24 2020

Keywords

Examples

			n(7) = 1 because only 7 mod 5 = 2 is even.
		

Programs

  • Mathematica
    Table[Total[Boole[EvenQ/@Mod[n,Range[2,n-1]]]],{n,80}] (* Harvey P. Dale, Aug 09 2021 *)
  • PARI
    a(n) = sum(k=2, n-1, ((n % k) % 2)== 0); \\ Michel Marcus, Feb 24 2020

A308469 a(1) = 1, a(2)=2, a(n) = a(n-1) + gcd(a(n-2), n-2).

Original entry on oeis.org

1, 2, 3, 5, 8, 9, 10, 13, 14, 15, 16, 21, 22, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 45, 46, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 93, 94, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113
Offset: 1

Author

Thomas Kerscher, May 29 2019

Keywords

Comments

Apparently, the distinct values of a(n)-n for n > 7 correspond to A190894. - Rémy Sigrist, Jul 23 2019

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := a[n] = a[n-1] + GCD[a[n-2], n-2]; Array[a, 70] (* Amiram Eldar, Aug 01 2019 *)

A284630 a(1)=1, a(2)=2; for n > 1, a(n+1) = (a(n-1) mod n) + n.

Original entry on oeis.org

1, 2, 3, 5, 7, 5, 7, 12, 15, 12, 15, 12, 15, 25, 15, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 52, 31, 52, 31, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105
Offset: 1

Author

Thomas Kerscher, Mar 31 2017

Keywords

Examples

			a(3) = a(1) (mod 2) + 2 = 3.
		

Crossrefs

Cf. A003817.

Programs

  • Maple
    A[1]:= 1: A[2]:= 2:
    for n from 3 to 200 do A[n]:= (A[n-2] mod (n-1)) + n-1 od:
    seq(A[n],n=1..200); # Robert Israel, Apr 04 2017
  • Mathematica
    a[n_] := a[n] = If[n < 3, n, Mod[a[n - 2], n - 1] + n - 1]; Array[a, 80] (* Michael De Vlieger, Apr 02 2017 *)
    nxt[{n_,a_,b_}]:={n+1,b,Mod[a,n]+n}; NestList[nxt,{2,1,2},100][[;;,2]] (* Harvey P. Dale, Jul 31 2023 *)
  • PARI
    a(n) = if (n<=2, n, (n-1) + a(n-2) % (n-1)); \\ Michel Marcus, Apr 02 2017

A283190 a(n) is the number of different values n mod k for 1 <= k <= floor(n/2).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 2, 3, 4, 2, 3, 3, 3, 4, 5, 4, 5, 4, 4, 5, 6, 5, 6, 7, 7, 7, 8, 6, 7, 7, 7, 8, 9, 8, 9, 9, 9, 10, 11, 9, 10, 9, 9, 10, 11, 10, 11, 12, 12, 12, 13, 12, 13, 13, 13, 14, 15, 13, 14, 14, 14, 15, 16, 15, 16, 15, 15, 16, 17, 16, 17, 17, 17, 17, 18, 17
Offset: 1

Author

Thomas Kerscher, Mar 02 2017

Keywords

Comments

a(n) is the number of distinct terms in the first half of the n-th row of the A048158 triangle. - Michel Marcus, Mar 04 2017
a(n)/n appears to converge to a constant, approximately 0.2296. Can this be proved, and does the constant have a closed form? - Robert Israel, Mar 13 2017
The constant that a(n)/n approaches is Sum {p prime} 1/(p^2+p)* Product {q prime < p} (q-1)/q. - Michael R Peake, Mar 16 2017

Examples

			a(7) = 2 because 7=0 (mod 1), 7=1 (mod 2), 7=1 (mod 3), two different results.
		

Crossrefs

Cf. A048158.

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    V:= Vector(N,1):
    V[1]:= 0:
    for m from 2 to N-1 do
      k:= m/min(numtheory:-factorset(m));
      ns:= [seq(n,n=m+1..min(N,m+k-1))];
      V[ns]:= map(`+`,V[ns],1);
    od:
    convert(V,list); # Robert Israel, Mar 13 2017
  • Mathematica
    Table[Length@ Union@ Map[Mod[n, #] &, Range@ Floor[n/2]], {n, 78}] (* Michael De Vlieger, Mar 03 2017 *)
  • PARI
    a(n) = #vecsort(vector(n\2, k, n % k),,8); \\ Michel Marcus, Mar 02 2017

A261929 a(n) is the number of different pairs (p,q) mod n not of the form (x*y,x+y) mod n for any (x,y).

Original entry on oeis.org

0, 1, 3, 8, 10, 18, 21, 36, 45, 55, 55, 96, 78, 112, 135, 160, 136, 216, 171, 280, 273, 286, 253, 408, 350, 403, 432, 560, 406, 630, 465, 656, 693, 697, 805, 1008, 666, 874, 975, 1180, 820, 1260, 903, 1408, 1485, 1288, 1081, 1728, 1323, 1675, 1683, 1976, 1378, 2025, 2035, 2352, 2109, 2059, 1711, 2880, 1830, 2356
Offset: 1

Author

Thomas Kerscher, Sep 06 2015

Keywords

Examples

			a(2) = 1 because only the pair (1,1) mod 2 doesn't exist as result from any (x*y,x+y) mod 2.
		

Crossrefs

Cf. A261928 (number of pairs that have such a form).

Formula

a(n) = n^2 - A261928(n).

A261928 a(n) is the number of different pairs (x*y,x+y) mod n.

Original entry on oeis.org

1, 3, 6, 8, 15, 18, 28, 28, 36, 45, 66, 48, 91, 84, 90, 96, 153, 108, 190, 120, 168, 198, 276, 168, 275, 273, 297, 224, 435, 270, 496, 368, 396, 459, 420, 288, 703, 570, 546, 420, 861, 504, 946, 528, 540, 828, 1128, 576, 1078, 825, 918, 728, 1431, 891, 990, 784, 1140, 1305, 1770, 720, 1891, 1488, 1008, 1408, 1365, 1188, 2278
Offset: 1

Author

Thomas Kerscher, Sep 06 2015

Keywords

Examples

			a(2) = 3 because there exist only the pairs (0,0), (0,1) and (1,0) as results from (x*y,x+y) mod n. There are no x,y with (x*y,x+y)=(1,1) mod 2.
		

Crossrefs

Cf. A261929 (number of other pairs).

Programs

  • PARI
    a(n)={my(v=vector(n)); for(i=1, n, for(j=1, n, v[j]=bitor(v[j], 1<<(i*(j-i)%n)))); sum(j=1, n, hammingweight(v[j]))} \\ Andrew Howroyd, Aug 01 2018

Formula

a(n) = n^2 - A261929(n).

Extensions

Keyword:mult added by Andrew Howroyd, Aug 01 2018

A157279 Product 1*2*...*r mod n, where r = integer part of sqrt(n).

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 8, 7, 6, 5, 4, 3, 2, 1, 0, 20, 16, 12, 8, 4, 0, 27, 24, 21, 18, 15, 0, 17, 36, 18, 0, 23, 6, 32, 16, 0, 30, 15, 0, 42, 40, 42, 48, 5, 18, 35, 0, 24, 52, 25, 0, 38, 18, 0, 0, 20, 60, 53, 64, 24, 0, 63, 0, 24, 64, 45, 40, 49, 72, 30, 0, 0, 30, 4, 0
Offset: 1

Author

Thomas Kerscher (Thomas.Kerscher(AT)web.de), Feb 26 2009

Keywords

Examples

			a(17) = (floor(sqrt(17)))! mod 17 = (floor(4.12...))! mod 17 = 4! mod 17 = 24 mod 17 = 7.
		

Crossrefs

Cf. A000142 (factorial numbers), A000196 (integer part of square root of n).

Programs

  • Magma
    [ Factorial(Floor(Sqrt(n))) mod n: n in [1..84] ];
  • Mathematica
    Table[Mod[Floor[Sqrt[n]]!,n],{n,90}] (* Harvey P. Dale, Feb 15 2022 *)

Formula

a(n) = (floor(sqrt(n)))! mod n.

Extensions

Edited and a(1) corrected by Klaus Brockhaus, May 27 2009

A100836 a(n) is the smallest value k > 1 such that k^2 - 1 is divisible by n^2.

Original entry on oeis.org

2, 3, 8, 7, 24, 17, 48, 31, 80, 49, 120, 17, 168, 97, 26, 127, 288, 161, 360, 49, 197, 241, 528, 127, 624, 337, 728, 97, 840, 199, 960, 511, 485, 577, 99, 161, 1368, 721, 170, 351, 1680, 197, 1848, 241, 649, 1057, 2208, 127, 2400, 1249, 577, 337, 2808, 1457, 1451
Offset: 1

Author

Thomas Kerscher (Thomas.Kerscher(AT)web.de), Jan 19 2005

Keywords

Comments

a(n) = n^2 - 1 if n > 1 is in A235868. - Robert Israel, Jan 17 2019

Examples

			a(4)=7 because 7^2 - 1 is divisible by 4^2 (and 7 is the smallest integer > 1 that satisfies this criterion).
		

Crossrefs

Cf. A235868.

Programs

  • Maple
    f:= n -> min(map(t -> rhs(op(t)),{msolve(k^2-1,n^2)}) minus {1}):
    f(1):= 2:
    map(f, [$1..100]); # Robert Israel, Jan 17 2019
  • Mathematica
    With[{c=Range[2,10000]},Flatten[Table[Select[c,Divisible[#^2-1, n^2]&, 1],{n,60}]]] (* Harvey P. Dale, Oct 23 2011 *)
  • PARI
    { A100836(n)=local(f,b,t,m); if(n==1,return(1)); if(n==2,return(3));t=valuation(n,2); if(n==2^t, return(2^(2*t-1)-1)); f=factorint(n/2^t);f=vector(matsize(f)[1],j,f[j,1]^(2*f[j,2])); if(t>0, f=concat(f,[2^(2*t-1)])); b=n^2+1; forvec(v=vector(#f,i,[0,1]), m=lift(chinese(vector(#f,j,Mod((-1)^v[j],f[j])))); if(m>1, b=min(b,m)); ); b } /* Max Alekseyev, Nov 21 2008 */

Extensions

Entries confirmed by Ray Chandler, R. J. Mathar, and Max Alekseyev, Nov 21 2008