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: Gary Detlefs

Gary Detlefs's wiki page.

Gary Detlefs has authored 73 sequences. Here are the ten most recent ones:

A382813 Denominator of the n-th partial sum of the squares of the harmonic numbers.

Original entry on oeis.org

1, 4, 18, 144, 200, 400, 4900, 78400, 635040, 6350400, 64033200, 768398400, 9275666400, 8657288640, 16232416200, 519437318400, 2779951574400, 16679709446400, 60213751101504, 3823095308032, 1216439416192, 26761667156224, 1769615240705312, 127412297330782464, 3062795608913040000
Offset: 1

Author

Gary Detlefs, Apr 05 2025

Keywords

Comments

All terms for n>1 are even.

Examples

			The squares of the first three harmonic numbers are 1, 9/4, 121/36 which sum to 119/18 so a(3) = 18.
		

Crossrefs

Cf. A001008, A002805, A382812 (numerators).

Programs

  • Maple
    H2:= n-> add(harmonic(k)^2, k = 1..n): seq(denom(H2(n)), n=1..25);
  • PARI
    a(n) = denominator(sum(k=1, n, sum(i=1, k, 1/i)^2)); \\ Michel Marcus, Apr 07 2025

Formula

a(n) = denominator((n+1)*H(n)^2-(2*n+1)*H(n)+2*n), where H(n) is the n-th harmonic number.
a(n) = denominator((S(n)*H(n)^2+(2*n-2*S(n)+1)*H(n) - 2*n)/(H(n) - 1)), where S(n) = the n-th partial sum of H(n).

A382812 Numerator of the n-th partial sum of the squares of the harmonic numbers.

Original entry on oeis.org

1, 13, 119, 1577, 3233, 8867, 141563, 2844129, 28119709, 335676251, 3968696491, 55023970333, 758025067309, 799020611041, 1676892996083, 59597395635137, 351844709221043, 2314823924364859, 9114392136427625, 628176680098075, 216039223801697, 5117413095318143, 363066107054194281, 27957386425926920257
Offset: 1

Author

Gary Detlefs, Apr 05 2025

Keywords

Examples

			The squares of the first three harmonic numbers are 1, 9/4, 121/36 which sum to 119/18 so a(3)=119.
		

Crossrefs

Cf. A001008, A002805, A382813 (denominators).

Programs

  • Maple
    H2:= n-> add(harmonic(k)^2, k = 1..n): seq(numer(H2(n)), n=1..25);
  • Mathematica
    Accumulate[HarmonicNumber[Range[30]]^2]//Numerator (* Harvey P. Dale, Aug 10 2025 *)
  • PARI
    a(n) = numerator(sum(k=1, n, sum(i=1, k, 1/i)^2)); \\ Michel Marcus, Apr 07 2025

Formula

a(n) = numerator((n+1)*H(n)^2-(2*n+1)*H(n) + 2*n), where H(n) is the n-th harmonic number.
a(n) = numerator((S(n)*H(n)^2 + (2*n - 2*S(n) + 1)*H(n)-2*n)/(H(n)-1)), where S(n) is the n-th partial sum of H(n).

A374192 Number of iterations required to reach 1 or 10 in a modified Collatz trajectory where x -> x/2 if x is even, x -> x+1 if x is odd and not divisible by 3 and x -> 3x+1 if x is odd and divisible by 3; or a(n) = -1 if 1 or 10 is never reached.

Original entry on oeis.org

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

Author

Gary Detlefs, Jun 30 2024

Keywords

Comments

It is conjectured that this iteration always reaches one of two cycles [1,2] or [10,5,6,3].

Examples

			n=1 takes a(1) = 0 iterations to reach 1 or 10, since it's already 1.
n=9 takes a(9) = 7 iterations to reach 1, by 9,28,14,7,8,4,2,1.
n=15 takes a(15) = 7 iterations to reach 10, by 15,46,23,24,12,6,3,10.
		

A366314 a(n) = a(n-1) + 3*a(n-2) + 9*a(n-3) with a(0)=0, a(1)=1, a(2)=4.

Original entry on oeis.org

0, 1, 4, 7, 28, 85, 232, 739, 2200, 6505, 19756, 59071, 176884, 531901, 1594192, 4781851, 14351536, 43044817, 129136084, 387434359, 1162245964, 3486773797, 10460420920, 31380955987, 94143182920, 282429839161, 847287991804, 2541866155567, 7625598683428, 22876789076365, 68630380526752
Offset: 0

Author

Gary Detlefs, Oct 06 2023

Keywords

Comments

This sequence could be considered a companion sequence to A103770, in that both sequences are manifested in the averaging of a Tribonacci sequence with initial seeds of x, y, z.
If f(n) is a third order recurrence with f(0)=x, f(1)=y, f(2)=z, and f(n) = (f(n-1)+f(n-2)+f(n-3))/3,n>2, then
f(n) =(A103770(n-2)*z + a(n-1)*y + A103770(n-3)x)/3^(n-2).
In the general case, these "averaging" sequences will approach a limit of (x+2*y+3*z)/6.
a(n) mod 9 repeats [1,4,7] from offset 1 = A100402(n-1)...

Examples

			Starting with initial terms of x, y, z, the sequence proceeds:
  (z + y + x)/3
  (4z + 4y +x)/9
  (16z + 7y + 4x)/27
  (37z + 28y + 16x)/81
  (121z + 85y + 37x)/243
  ....
		

Crossrefs

Cf. A103770.

Programs

  • Maple
    a:= proc(n) option remember; if n < 3 then n^2 else a(n-1)+3*a(n-2)+9*a(n-3) fi end: seq(a(n), n=0..30);
  • Mathematica
    LinearRecurrence[{1,3,9},{0,1,4},50] (* Paolo Xausa, Nov 14 2023 *)

Formula

From Stefano Spezia, Oct 15 2023: (Start)
G.f.: x*(1 + 3*x)/((1 - 3*x)*(1 + 2*x + 3*x^2)).
a(n) = (4*3^n + (-2 - sqrt(2)*i)*(-1 - sqrt(2)*i)^n + i*(-1 + sqrt(2)*i)^n*(2*i + sqrt(2)))/12, where i denotes the imaginary unit. (End)

A350747 Number of iterations required to terminate trajectory mapping described in A349824.

Original entry on oeis.org

0, 1, 0, 0, 8, 0, 9, 0, 7, 4, 8, 0, 3, 0, 7, 8, 7, 0, 6, 0, 1, 2, 2, 0, 5, 2, 1, 0, 0, 0, 0, 0, 6, 0, 7, 6, 4, 0, 6, 7, 3, 0, 5, 0, 2, 1, 6, 0, 8, 1, 5, 4, 5, 0, 3, 7, 6, 3, 11, 0, 9, 0, 10, 8, 11, 5, 9, 0, 9, 6, 6, 0, 10
Offset: 0

Author

Gary Detlefs, Jan 13 2022

Keywords

Comments

From Wolfdieter Lang, Feb 09 2022: (Start)
Conjecture from A349824: the iteration f: n -> A349824(n) becomes periodic for each n >= 0.
a(n) gives the number of steps from n to reach the first member of the periodic part. There are the two length 2 periods: (33,28) and (28,33). (End)
It appears that the only nonprime values of n for which a(n) = 0 are {0, 27, 28, 30, 33}.

Examples

			For n = 6, the trajectory is 6, 10, 14, 18, 24, 36, 40, 44, 45, 33, ... so a(6) = 9.
For n = 24, the trajectory is 24, 36, 40, 44, 45, 33, ... so a(24) = 5.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A001222:= n -> bigomega(n):
    A001414:= proc(n) local e, j; e:=ifactors(n)[2]; add(e[j][1] * e[j][2],j= 1..nops(e)) end proc :
    B := n-> A001414(n) * A001222(n):
    g:= proc(n) if isprime(n) or n=0 or n=27 or n=28 or n=30 or n=33 then return 0 else return 1 fi end proc:
    F:= proc(n) local v,i; v:=n;if n = 1 then return 1 else if g(n)=0 then return 0 else for i from 0 to 100 do v:= B(v);if  v=27 or v=28 or v=30 or v=33 then return i+1; i:=100 fi od fi fi end proc :
    Seq(F(n), n=0..100)

Extensions

More terms from Jinyuan Wang, Jan 15 2022
Edited by Wolfdieter Lang, Feb 09 2022

A343689 a(1)=0, a(2)=1, a(n) = (4*n-2)*a(n-1) + a(n-2), n > 2.

Original entry on oeis.org

0, 1, 10, 141, 2548, 56197, 1463670, 43966297, 1496317768, 56904041481, 2391466059970, 110064342800101, 5505608606065020, 297412929070311181, 17255455494684113518, 1070135653599485349297, 70646208593060717167120, 4946304737167849687047697, 366097196759013937558696698
Offset: 1

Author

Gary Detlefs, Apr 26 2021

Keywords

Comments

This sequence is one of the two "basis" sequences for sequences having the form s(a,b,1)=a, s(a,b,2)=b, s(n)=(4*n-2)*s(a,b,n-1) + s(a,b,n-2), the second being A343688. s(a,b,n) = a*A343688(n) + b*a(n).
Of specific interest is s(3,19,n) and s(1,7,n) which produce the odd terms of A340737 and A340738 respectively and whose quotient converges to e.
a(n) mod n = 1 for even n and n-2 for odd n (empirical).

Examples

			a(4)=14*10+1, a(5)=18*141+10...
		

Crossrefs

Programs

  • Maple
    e := proc(a, b, n) option remember; if n = 1 then a; else if n = 2 then b; else (4*n - 2)*e(a, b, n - 1) + e(a, b, n - 2); end if; end if; end proc
    for n from 1 to 20 do print(e(0,1,n)) od
  • Mathematica
    RecurrenceTable[{a[1]==0,a[2]==1,a[n]==(4n-2)a[n-1]+a[n-2]},a,{n,20}] (* Harvey P. Dale, Dec 17 2021 *)

Formula

a(1)=0, a(1)=1, a(n) = (4*n-2)*a(n-1) + a(n-2).

A343688 a(1)=1, a(2)=0, a(n) = (4*n-2)*a(n-1) + a(n-2), n > 2.

Original entry on oeis.org

1, 0, 1, 14, 253, 5580, 145333, 4365570, 148574713, 5650204664, 237457170601, 10928680052310, 546671459786101, 29531187508501764, 1713355546952888413, 106257575098587583370, 7014713312053733390833, 491136189418859924941680, 36351092730307688179075153
Offset: 1

Author

Gary Detlefs, Apr 26 2021

Keywords

Comments

This sequence is one of the two "basis" sequences for sequences having the form s(a,b,1)=a, s(a,b,2)=b, s(n) = (4*n-2)*s(a,b,n-1) + s(a,b,n-2), the second being A343689. s(a,b,n) = a*a(n) + b*A343689(n).
Of specific interest is s(3,19,n) and s(1,7,n) which produce the odd terms of A340737 and A340738 respectively and whose quotient converges to e.
It is of interest to note that a(n)*A343689(n+1) - a(n+1)*A343689(n) = (-1)^(n+1), a(n)*A343689(n+2) - a(n+2)*A343689(n) = (4*n+6)*(-1)^(n+1) and a(n)*A343689(n+3) - a(n+3)*A343689(n) =((4*n+8)^2-3)* (-1)^(n+1)
a(n) mod n = n-6 for even n > 4 and 13 for odd n > 13 (empirical).

Examples

			a(4)=14*1+0, a(5)=18*14+1, ...
		

Crossrefs

Programs

  • Maple
    e := proc(a, b, n) option remember; if n = 1 then a; else if n = 2 then b; else (4*n - 2)*e(a, b, n - 1) + e(a, b, n - 2); end if; end if; end proc;
    for n from 1 to 20 do print(e(1,0,n)) od
  • Mathematica
    a[1]=1;a[2]=0;a[n_]:=a[n]=(4n-2)a[n-1]+a[n-2];Array[a,20] (* Giorgos Kalogeropoulos, Apr 27 2021 *)

Formula

a(1)=1, a(2)=0, a(n) = (4*n-2)*a(n-1) + a(n-2), n > 2.

A340738 Denominator of a sequence of fractions converging to e.

Original entry on oeis.org

1, 2, 7, 18, 71, 252, 1001, 4540, 18089, 99990, 398959, 2602278, 10391023, 78132152, 312129649, 2658297528, 10622799089, 101072656170, 403978495031, 4247085597370, 16977719590391, 195445764537012, 781379079653017, 9775727355457908, 39085931702241241, 528050767520083262, 2111421691000680031
Offset: 1

Author

Gary Detlefs, Jan 18 2021

Keywords

Comments

This sequence is a subset of the numerators of a sequence of fractions converging to e which was obtained by the use of a program which searched for a fraction having a closer value to e than the preceding one. The initial terms of this sequence were 3/1, 5/2, 8/3, 11/4, 19/7, 49/18, 68/25, 87/32, 106/39, 193/71, 685/252, 878/323, 1071/394, 1264/465, 1457/536, 2721/1001, 12341/4540. The subset of the denominators filtered out of this sequence are a(1)..a(8).
The convergence is conjectured.

Examples

			Sequence of fractions begins 3/1, 5/2, 19/7, 49/18, 193/71, 685/252, 2721/1001, 12341/4540, ...
		

Crossrefs

Numerators are listed in A340737.

Programs

  • Maple
    e:=proc(a,b,n)option remember; e(a,b,1):=a; e(a,b,2):=b; if n>2 and n mod 2 =1 then 2*e(a,b,n-1)+n*e(a,b,n-2) else if n>3 and n mod 2 = 0 then (n+2)*e(a,b,n-1)/2 -(e(a,b,n-2)+(n-2)*e(a,b,n-3)/2) fi fi end
    seq(e(1,2,n), n = 1..20)
    # code to print the sequence of fractions and error
    for n from 1` to 20 do print(e(3,5,n)/e(1,2,n), evalf(exp(1)-e(3,5,n)/e(1,2,n)) od
  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := a[n] = If[EvenQ[n], (n + 2)*a[n - 1]/2 - (a[n - 2] + (n - 2)*a[n - 3]/2), 2*a[n - 1] + n*a[n - 2]]; Array[a, 20] (* Amiram Eldar, Jan 18 2021 *)

Formula

a(1) = 1, a(2) = 2; for n > 2, a(n) = (n+2)*a(n-1)/2 - a(n-2) - (n-2)*a(n-3)/2 if n is even, 2*a(n-1) + n*a(n-2) otherwise.

A340737 Numerators of a sequence of fractions converging to e.

Original entry on oeis.org

3, 5, 19, 49, 193, 685, 2721, 12341, 49171, 271801, 1084483, 7073725, 28245729, 212385209, 848456353, 7226001865, 28875761731, 274743964621, 1098127402131, 11544775603241, 46150226651233, 531276670190245, 2124008553358849, 26573182030311229, 106246577894593683, 1435390805853694145
Offset: 1

Author

Gary Detlefs, Jan 18 2021

Keywords

Comments

This sequence is a subset of the numerators of a sequence of fractions converging to e which was obtained by the use of a program which searched for a fraction having a closer value to e than the preceding one. The initial terms of this sequence were 3/1, 5/2, 8/3, 11/4, 19/7, 49/18, 68/25, 87/32, 106/39, 193/71, 685/252, 878/323, 1071/394, 1264/465, 1457/536, 2721/1001, 12341/4540. The subset of the numerators filtered out of this sequence are a(1)..a(8).
The convergence is conjectured.

Examples

			Sequence of fractions begins 3/1, 5/2, 19/7, 49/18, 193/71, 685/252, 2721/1001, 12341/4540, ...
		

Crossrefs

Denominators are listed in A340738.

Programs

  • Maple
    e:=proc(a,b,n)option remember; e(a,b,1):=a; e(a,b,2):=b; if n>2 and n mod 2 =1 then 2*e(a,b,n-1)+n*e(a,b,n-2) else if n>3 and n mod 2 = 0 then (n+2)*e(a,b,n-1)/2 -(e(a,b,n-2)+(n-2)*e(a,b,n-3)/2) fi fi end
    seq(e(3,5,n), n = 1..20)
    # code to print the sequence of fractions and error
    for n from 1` to 20 do print(e(3,5,n)/e(1,2,n), evalf(exp(1)-e(3,5,n)/e(1,2,n)) od
  • Mathematica
    a[1] = 3; a[2] = 5; a[n_] := a[n] = If[EvenQ[n], (n + 2)*a[n - 1]/2 - (a[n - 2] + (n - 2)*a[n - 3]/2), 2*a[n - 1] + n*a[n - 2]]; Array[a, 20] (* Amiram Eldar, Jan 18 2021 *)

Formula

a(1) = 3, a(2) = 5; for n > 2, a(n) = (n+2)*a(n-1)/2 - a(n-2) - (n-2)*a(n-3)/2 if n is even, 2*a(n-1) + n*a(n-2) otherwise.

A338192 Sum of Fibonacci and tribonacci numbers: a(n) = A000073(n) + A000045(n).

Original entry on oeis.org

0, 1, 2, 3, 5, 9, 15, 26, 45, 78, 136, 238, 418, 737, 1304, 2315, 4123, 7365, 13193, 23694, 42655, 76958, 139126, 251974, 457112, 830501, 1510930, 2752175, 5018581, 9160293, 16734631, 30595694, 55976389, 102474674, 187700488, 343973242, 630623826, 1156594669
Offset: 0

Author

Gary Detlefs, Oct 15 2020

Keywords

Comments

In general, the sum of a second-order sequence with signature (a,b) and a third-order sequence with signature (x,y,z) will be a fifth-order sequence with signature (a+x,-x*a+b+y, -y*a+z-b*x,-a*z-b*y,-b*z). In this instance, a=b=x=y=z=1 resulting in a signature of (2,1,-1,-2,-1).

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, 1, -1, -2, -1}, {0, 1, 2, 3, 5}, 50] (* Amiram Eldar, Oct 15 2020 *)

Formula

a(n) = A000073(n) + A000045(n).
a(n) = 2*a(n-1) + a(n-2) - a(n-3) - 2*a(n-4) - a(n-5) for n > 4 with a(0)=0, a(1)=1, a(2)=2, a(3)=3, a(4)=5.
G.f.: x*(1 - 2*x^2 - 2*x^3)/(1 - 2*x - x^2 + x^3 + 2*x^4 + x^5). - Stefano Spezia, Oct 15 2020