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: Ralf Stephan

Ralf Stephan's wiki page.

Ralf Stephan has authored 748 sequences. Here are the ten most recent ones:

A385110 Terms of A198587 congruent {1, 3, 7} (mod 8).

Original entry on oeis.org

17, 35, 75, 151, 1137, 2275, 2417, 4835, 4849, 9699, 19417, 38833, 38835, 72817, 77667, 145635, 154737, 309475, 310385, 620771, 621377, 1242737, 1242755, 2485361, 2485475, 4660337, 4970723, 4971025, 9320675, 9903217, 9942051, 19806435, 19864689, 19884107, 39729379
Offset: 1

Author

Ralf Stephan, Jun 18 2025

Keywords

Comments

Sorted set of all A385109(A198587(i)), i>0.

Crossrefs

Programs

  • PARI
    N=3;for(n=1, 1000000, s=n; t=0; while(s!=1, if(s%2==0, s=s/2, s=(3*s+1)/2; t++); if(s==1&&t==N&&(n%8==1||n%8==3||n%8==7), print1(n,", ") ); ))

Extensions

a(22)-a(31) from Michel Marcus, Jun 19 2025
a(32)-a(35) added using A198587 by Jinyuan Wang, Jun 26 2025

A385109 If n is 5 (mod 8) then apply n = (n-1)/4 until the result is not equivalent 5 (mod 8); otherwise a(n) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 7, 8, 9, 10, 11, 12, 3, 14, 15, 16, 17, 18, 19, 20, 1, 22, 23, 24, 25, 26, 27, 28, 7, 30, 31, 32, 33, 34, 35, 36, 9, 38, 39, 40, 41, 42, 43, 44, 11, 46, 47, 48, 49, 50, 51, 52, 3, 54, 55, 56, 57, 58, 59, 60, 15, 62, 63, 64, 65, 66, 67, 68, 17, 70, 71, 72, 73, 74, 75, 76, 19
Offset: 0

Author

Ralf Stephan, Jun 18 2025

Keywords

Comments

a(8*n + 5) = A347840(n).

Examples

			a(37): n is 5 (mod 8), so n = (37-1)/4 = 9, which is 1 (mod 8), so a(37) = 9.
a(53): n is 5 (mod 8), so n = (53-1)/4 = 13, which is 5 (mod 8), so n = (13-1)/4 = 3, and, as 3 is 3 (mod 8), a(53) = 3.
		

Crossrefs

Cf. A347840.

Programs

  • Mathematica
    A385109[n_] := NestWhile[(# - 1)/4 &, n , Mod[#, 8] == 5 &];
    Array[A385109, 100, 0] (* Paolo Xausa, Jun 25 2025 *)
  • PARI
    a(n) = if(n%8!=5, n, m=n; while(m%8==5, m=(m-1)/4); m)

Formula

Recurrence: a(1) = 1, a(2n) = 2n, a(4n+3) = 4n+3, a(8n+1) = 8n+1, a(8n+5) = a(2n+1).

A375071 Smallest k such that Product_{i=1..k} (n+i) divides Product_{i=1..k} (n+k+i), or 0 if there is no such k.

Original entry on oeis.org

1, 5, 4, 207, 206, 2475, 984, 8171, 8170, 45144, 45143, 3648830, 3648829, 7979077, 7979076, 58068862, 58068861, 255278295, 255278294
Offset: 0

Author

Ralf Stephan, Jul 29 2024

Comments

Erdős and Straus asked if a(n) exists for all n.

Examples

			3*4*5*6 ∣ 7*8*9*10, so a(2) = 4.
		

Programs

  • PARI
    a(n) = my(k=1); while(prod(i=1, k, n+k+i)%prod(i=1, k, n+i), k++); k;
    
  • Python
    from itertools import count
    def A375071(n):
        a, b = n+1, n+2
        for k in count(1):
            if not b%a:
                return k
            a *= n+k+1
            b = b*(n+2*k+1)*(n+2*k+2)//(n+k+1) # Chai Wah Wu, Aug 01 2024

Extensions

a(10)-a(18) from Bhavik Mehta, Aug 16 2024

A375081 Smallest k>n such that the denominator of Sum {i=n..k} (1/i) is larger than the denominator of Sum {i=n..k+1} (1/i).

Original entry on oeis.org

5, 5, 5, 17, 17, 14, 14, 14, 14, 14, 32, 34, 34, 34, 27, 27, 27, 27, 23, 23, 27, 51, 51, 51, 51, 44, 44, 44, 44, 44, 39, 39, 39, 39, 39, 44, 74, 74, 74, 74, 74, 74, 74, 74, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 59, 71, 71, 71, 71, 71, 71, 71, 71, 76, 76, 76
Offset: 1

Author

Ralf Stephan, Jul 29 2024

Keywords

Examples

			1/3+1/4+1/5=47/60 and 1/3+1/4+1/5+1/6=19/20, and 60>20, so a(3)=5.
		

Programs

  • PARI
    a(n) = for(k=0, oo, my(s=sum(n=n, n+k, 1/n)); if(denominator(s)>denominator(s+1/(n+k+1)), return(n+k); break))
    
  • Python
    from fractions import Fraction
    from itertools import count
    def A375081(n):
        a = Fraction((n<<1)+1,n*(n+1))
        for k in count(n+1):
            if a.denominator > (a:=a+Fraction(1,k+1)).denominator:
                return k # Chai Wah Wu, Jul 30 2024

Formula

a(n) < 4.374*n for all n > 1. - Wouter van Doorn, Nov 06 2024
a(n) > n + 0.54*log(n) for all large enough n, and there are infinitely many n with a(n) < n + 0.61*log(n). - Wouter van Doorn, Feb 06 2025

Extensions

a(56) onwards from Bhavik Mehta, Jul 31 2024

A375077 Smallest k such that Product_{i=0..n} (k-i) divides C(2k,k).

Original entry on oeis.org

2, 2480, 8178, 45153, 3648841, 7979090, 101130029
Offset: 1

Author

Ralf Stephan, Jul 29 2024

Crossrefs

Programs

  • PARI
    for(n=1,20,for(k=n+1,100000,if(binomial(2*k,k)%prod(i=0,n,k-i)==0,print(n," ",k);break)))
    
  • Python
    from math import prod, comb
    def A375077(n):
        a, c, k = prod(n+1-i for i in range(n+1)), comb(n+1<<1,n+1), n+1
        while c%a:
            k += 1
            a = a*k//(k-n-1)
            c = c*((k<<1)-1<<1)//k
        return k # Chai Wah Wu, Jul 30 2024

Extensions

a(5) from Chai Wah Wu, Aug 01 2024
a(6)-a(7) from Max Alekseyev, Feb 25 2025

A249328 Position where n occurs first in the continued fraction expansion of e^3.

Original entry on oeis.org

2, 3, 5, 4, 7, 18, 32, 91, 142, 454, 1, 245, 15, 16, 126, 10, 304, 74, 202, 0, 296, 409, 227, 89, 865, 425, 183, 384, 616, 634, 1200, 1467, 1226, 159, 233, 2023, 584, 1384, 745, 764, 770, 329, 1582, 1721, 585, 85, 392, 136, 3984, 740, 302, 890
Offset: 1

Author

Ralf Stephan, Jan 12 2015

Keywords

Crossrefs

Cf. A058282.

Programs

  • Sage
    l = continued_fraction(exp(3))[:10000]
    [next((i for i, x in enumerate(l) if x == n), None) for n in range(1,100)]

A242983 n/2 * (n^3 - 2*n^2 - 2*n + 5).

Original entry on oeis.org

0, 1, 1, 12, 58, 175, 411, 826, 1492, 2493, 3925, 5896, 8526, 11947, 16303, 21750, 28456, 36601, 46377, 57988, 71650, 87591, 106051, 127282, 151548, 179125, 210301, 245376, 284662, 328483, 377175, 431086, 490576, 556017
Offset: 0

Author

Ralf Stephan, Jun 09 2014

Keywords

Comments

For n>1, number of ways to place two dominoes horizontally on an n X n chessboard.

Crossrefs

Programs

  • Mathematica
    Table[n/2 (n^3-2n^2-2n+5),{n,0,40}] (* or *) LinearRecurrence[{5,-10,10,-5,1},{0,1,1,12,58},40] (* Harvey P. Dale, Jul 19 2018 *)

Formula

a(n) = A019582(n) + A077414(n-2), n>1.
G.f.: x*(-2*x^3 + 17*x^2 - 4*x + 1) / (1-x)^5.

A243256 Smallest distance of the n-th Fibonacci number to the set of all square integers.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 3, 4, 2, 6, 8, 0, 8, 16, 15, 26, 3, 17, 44, 41, 79, 22, 96, 143, 51, 289, 169, 285, 140, 296, 669, 267, 1449, 343, 1979, 144, 592, 665, 4223, 699, 5283, 2872, 19604, 6477, 21826, 17999, 16008, 46080, 31240, 102696, 8638, 45526, 95764
Offset: 0

Author

Ralf Stephan, Jun 02 2014

Keywords

Comments

a(n) = 0 if and only if n = 0, 1, 2, 12.
The sorted unique members: 0, 1, 2, 3, 4, 6, 8, 15, 16, 17, 22, 26 ...

Programs

  • PARI
    {a(n) = my(f, i); if( n<0, 0, i = sqrtint( f = fibonacci(n))); min(f - i^2, (i+1)^2 - f)}; /* Michael Somos, Jun 02 2014 */
  • Sage
    def a(n):
        f = fibonacci(n)
        return min((floor(sqrt(f))+1)^2 - f, f - floor(sqrt(f))^2)
    

Formula

a(n) = min(A190993(n), A216223(n)).

A242861 Triangle T(n,k) by rows: number of ways k dominoes can be placed on an n X n chessboard, k>=0.

Original entry on oeis.org

1, 1, 1, 4, 2, 1, 12, 44, 56, 18, 1, 24, 224, 1044, 2593, 3388, 2150, 552, 36, 1, 40, 686, 6632, 39979, 157000, 407620, 695848, 762180, 510752, 192672, 35104, 2180, 1, 60, 1622, 26172, 281514, 2135356, 11785382, 48145820, 146702793, 333518324, 562203148
Offset: 0

Author

Ralf Stephan, May 24 2014

Keywords

Comments

Also, coefficients of the matching-generating polynomial of the n X n grid graph.
In the n-th row there are floor(n^2/2)+1 values.

Examples

			Triangle starts:
  1
  1
  1  4   2
  1 12  44   56    18
  1 24 224 1044  2593   3388   2150    552     36
  1 40 686 6632 39979 157000 407620 695848 762180 510752 192672 35104 2180
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l) option remember; local k;
          if n=0 then 1
        elif min(l[])>0 then b(n-1, map(h->h-1, l))
        else for k while l[k]>0 do od; expand(`if`(n>1,
             x*b(n, subsop(k=2, l)), 0) +`if`(k (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$n])):
    seq(T(n), n=0..8); # Alois P. Heinz, Jun 01 2014
  • Mathematica
    b[n_, l_List] := b[n, l] =  Module[{k}, Which[n == 0, 1, Min[l]>0, b[n-1, l-1], True, For[k=1, l[[k]]>0, k++]; Expand[If[n>1, x*b[n, ReplacePart[l, k -> 2]], 0] + If[k 1, k + 1 -> 1}]], 0] + b[n, ReplacePart[l, k -> 1]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, Array[0&, n]]]; Table[T[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, Jun 16 2015, after Alois P. Heinz *)
  • Sage
    def T(n,k):
       G = Graph(graphs.Grid2dGraph(n,n))
       G.relabel()
       mu = G.matching_polynomial()
       return abs(mu[n^2-2*k])

Formula

T(n,1) = A046092(n-1), T(n,2) = A242856(n).
T(n,floor(n^2/2)) = A137308(n), T(2n,2n^2) = A004003(n).
sum(k>=0, T(n,k)) = A210662(n,n) = A028420(n).
T(n,3) = A243206(n), T(n,4) = A243215(n), T(n,5) = A243217(n), T(n,floor(n^2/4)) = A243221(n). - Alois P. Heinz, Jun 01 2014

A242856 Number of 2-matchings of the n X n grid graph.

Original entry on oeis.org

2, 44, 224, 686, 1622, 3272, 5924, 9914, 15626, 23492, 33992, 47654, 65054, 86816, 113612, 146162, 185234, 231644, 286256, 349982, 423782, 508664, 605684, 715946, 840602, 980852, 1137944, 1313174, 1507886, 1723472, 1961372, 2223074, 2510114, 2824076, 3166592
Offset: 2

Author

Ralf Stephan, May 24 2014

Keywords

Comments

Number of ways two dominoes can be placed on an n X n chessboard.

Crossrefs

Second column of A242861. Cf. A016742, A046092, A054000, A210662.

Programs

  • Mathematica
    LinearRecurrence[{5, -10, 10, -5, 1}, {2, 44, 224, 686, 1622}, 50] (* Paolo Xausa, May 20 2024 *)
  • PARI
    Vec(-2*x^2*(x^4-7*x^3+12*x^2+17*x+1)/(x-1)^5 + O(x^100)) \\ Colin Barker, Jun 26 2014
  • Sage
    def a(n):
        G = Graph(graphs.Grid2dGraph(n,n))
        G.relabel()
        return G.matching_polynomial()[n^2-4]
    

Formula

a(n) = 2*n^4 - 4*n^3 - 5*n^2 + 13*n - 4.
G.f.: -2*x^2*(x^4-7*x^3+12*x^2+17*x+1) / (x-1)^5. - Colin Barker, Jun 26 2014
a(n + 1) = (1/2)*A046092(n)*(A046092(n) - 1) - A016742(n) - A054000(n). - Nicolas Bělohoubek, May 15 2024
E.g.f.: 4 - 2*x + exp(x)*(2*x^4 + 8*x^3 - 3*x^2 + 6*x - 4). - Stefano Spezia, Jun 04 2024

Extensions

a(7)-a(36) from Alois P. Heinz, Jun 01 2014