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: Joseph Foley

Joseph Foley's wiki page.

Joseph Foley has authored 3 sequences.

A277425 a(n) = sqrt(16*t^2 - 32*t + k^2 + 8*k - 8*k*t + 16), where t = ceiling(sqrt(n)) and k = t^2 - n.

Original entry on oeis.org

0, 2, 3, 4, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12, 8, 9, 10, 11, 12, 13, 14, 15, 16, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
Offset: 1

Author

Joseph Foley, Oct 14 2016

Keywords

Comments

The equation 16*t^2 - 32*t + k^2 + 8*k - 8*k*t + 16 always produces a square, for any number n, with any t and k (i.e., t can be incremented and a corresponding k value is produced).

Examples

			n = 3, f(n) = 3; n = 11, f(n) = 7; n = 64, f(n) = 28; n = 103, f(n) = 22; n=208, f(n)= 39.
		

Programs

  • Magma
    [n-Ceiling(Sqrt(n)-2)^2: n in [1..80]]; // Vincenzo Librandi, Nov 06 2016
  • Maple
    seq(n-ceil(sqrt(n)-2)^2, n = 1 .. 64); # Ridouane Oudra, Jun 11 2019
  • Mathematica
    Table[Function[t, Function[k, Sqrt[16 t^2 - 32 t + k^2 + 8 k - 8 k t + 16]][t^2 - n]]@ Ceiling@ Sqrt@ n, {n, 64}] (* or *)
    Table[n - Ceiling[Sqrt[n] - 2]^2, {n, 64}] (* Michael De Vlieger, Nov 06 2016 *)
  • PARI
    a(n) = n - (sqrtint(n-1)-1)^2 \\ Charles R Greathouse IV, Oct 14 2016
    

Formula

a(n) ~ 2*sqrt(n). - Charles R Greathouse IV, Oct 14 2016
a(n) = n - (floor(sqrt(n-1))-1)^2. - Charles R Greathouse IV, Oct 14 2016
a(n) = n - ceiling(sqrt(n) - 2)^2. - Vincenzo Librandi, Nov 06 2016

A194541 Partial sums of A004080.

Original entry on oeis.org

1, 5, 16, 47, 130, 357, 973, 2647, 7197, 19564, 53181, 144561, 392958, 1068172, 2903593, 7892784, 21454811, 58320223, 158530804, 430931404, 1171393005, 3184176320, 8655488630, 23528057461, 63955891057, 173850136486, 472573666887, 1284588411309
Offset: 1

Author

Joseph Foley, Aug 28 2011

Keywords

Comments

The ratio of a(n) to A004080(n+1) converges to e/(e-1), which is approximately equal to 1.581976706. For example, a(21)/A004080(22) = 1171393005/740461601 = 1.581976706716...

Crossrefs

Cf. A004080.

A179385 The n-th term is the sum of all the 1's generated from all the combinations of prime numbers and ones possible, that add to n, when each prime is only allowed once and any number of ones are allowed.

Original entry on oeis.org

1, 2, 4, 7, 10, 15, 20, 27, 35, 44, 55, 67, 81, 97, 115, 135, 158, 183, 212, 244, 280, 320, 364, 413, 467, 526, 591, 661, 737, 820, 909, 1007, 1112, 1226, 1349, 1481, 1624, 1778, 1943, 2121, 2311, 2515, 2734, 2968, 3219, 3486, 3771, 4075, 4399, 4744, 5112, 5502
Offset: 1

Author

Joseph Foley, Jul 12 2010

Keywords

Examples

			n=7 gives 11111 11, 2111 11, 311 11, 5 11, 5 2, 32 11. (Grouped in 5's) no. of 1's: 7, 5, 4, 2, 0, 2. Sum is 20, therefore a(7) = 20.
n=12 gives 11111 11111 11, 11111 11111 2, 11111 311 11, 11111 32 11, 11111 5 11, 5 2111 11, 5 311 11, 5 32 11, 7111 11, 721 11, 73 11, 73 2, 75, eleven 1, no. of 1's: 12, 10, 9, 7, 7, 5, 4, 2, 5, 3, 2, 0, 0, 1. Sum is 67, therefore a(12) = 67.
1: 1 => 1 2: 11, 2 => 2 3: 111, 21 => 4 4: 1111, 211, 22, 31 => 7 5: 11111, 2111, 311, 23 => 10 6: 11111 1, 2111 1, 311 1, 23 1, 5 1 => 15 and so on.
		

Crossrefs

Programs

  • Maple
    b:= proc(n,i) option remember; if n<=0 then 0 elif i=0 then n else b(n, i-1) +b(n-ithprime(i), i-1) fi end: # R. J. Mathar, Jul 14 2010
    a:= n-> b(n, numtheory[pi](n)): seq(a(n), n=1..80); # Alois P. Heinz
  • Mathematica
    fQ[lst_List] := Sort@ Flatten@ Most@ Split@ lst == Rest@ Union@ lst; f[n_] := Sum[ Count[ Select[ IntegerPartitions[n, {k}, Join[{1}, Prime@ Range@ PrimePi@n]], fQ@# &], 1, 2], {k, n}]; Array[f, 50] (* improved by Robert G. Wilson v, Jul 20 2010 *)
    (* second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1] + If[Prime[i] > n, 0, b[n - Prime[i], i - 1]]]];
    a[n_] := Sum[k*b[n - k, PrimePi[n - k]], {k, 1, n}];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
  • PARI
    a(n) = my(r); r = x/(1-x)^2 + O(x^(n+1)); forprime(p=2,n,r*=1+x^p); polcoeff(r,n) \\ Max Alekseyev, Jul 14 2010

Formula

a(n) = Sum_{k=1..n} k * A000586(n-k). - Max Alekseyev, Jul 14 2010

Extensions

Corrected and extended by R. J. Mathar, Jul 14 2010