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.

Previous Showing 11-12 of 12 results.

A164283 Number of ways to write n as the root-mean-square (RMS) of a set of distinct positive integers.

Original entry on oeis.org

1, 1, 1, 1, 3, 9, 19, 79, 225, 693, 1901, 5597, 17641, 57503, 195431, 647139, 2182987, 7344451, 25057681, 85742999, 295284367, 1028155825, 3596134963, 12659796475, 44696280143, 158226554179, 562623263251, 2006471222195, 7182910999719, 25795458946677, 92875047372825, 335362896810137
Offset: 1

Views

Author

Alois P. Heinz, Aug 12 2009

Keywords

Examples

			a(6) = 9, because 6 is the RMS of 9 sets of distinct positive integers: 6 = RMS(6) = RMS(1,3,5,8,9) = RMS(3,4,5,7,9) = RMS(1,2,4,5,7,11) = RMS(1,3,5,6,8,9) = RMS(3,4,5,6,7,9) = RMS(1,2,3,5,7,8,10) = RMS(1,2,4,5,6,7,11) = RMS(1,2,3,5,6,7,8,10).
		

Crossrefs

Programs

  • Haskell
    a164283 n = f [1..] 1 nn 0 where
       f (k:ks) l nl xx
         | yy > nl  = 0
         | yy < nl  = f ks (l + 1) (nl + nn) yy + f ks l nl xx
         | otherwise = if w == n then 1 else 0
         where w = if r == 0 then a000196 m else 0
               (m, r) = divMod yy l
               yy = xx + k * k
       nn = n ^ 2
    -- Reinhard Zumkeller, Feb 13 2013
  • Maple
    sns:= proc(i) option remember; `if`(i=1, 1, sns(i-1) +i^2) end: b:= proc(n, i, t) if n<0 or i
    				
  • Mathematica
    sns[i_] := sns[i] = If[i == 1, 1, sns[i-1] + i^2] ; b[n_, i_, t_] := Which[n < 0 || i < t, 0, n == 0, If[t == 0, 1, 0], i == 1, If[n == 1 && t == 1, 1, 0], True, b[n, i, t] = b[n, i-1, t] + b[n - i^2, i-1, t-1]]; a[n_] := a[n] = Module[{s = 1, k}, For[k = 2, sns[k] <= k*n^2, k++, s = s + b[k*n^2, Floor[Sqrt[k*n^2 - sns[k-1]]], k]]; s]; Table[Print[an = a[n]]; an, {n, 1, 29}] (* Jean-François Alcover, Dec 30 2013, translated from Maple *)

A066572 Number of sets of distinct positive integers with geometric mean n.

Original entry on oeis.org

1, 3, 3, 9, 3, 255, 3, 31, 9, 255, 3, 48891, 3, 255, 255, 117, 3, 48891, 3, 48891, 255, 255, 3, 12896331, 9, 255, 31, 48891, 3, 329166915027, 3, 479, 255, 255, 255, 668187863, 3, 255, 255, 12896331, 3, 329166915027, 3, 48891, 48891, 255, 3, 3981060137, 9, 48891, 255, 48891, 3, 12896331, 255, 12896331, 255, 255, 3
Offset: 1

Views

Author

Amarnath Murthy, Dec 19 2001

Keywords

Comments

a(m) = a(n) if m and n have the same factorization structure.
a(60) is approximately 9.3492e20. - Franklin T. Adams-Watters, Jun 09 2006
Observe that for any prime p, a(p^k) = A066571(k+1) and the largest set is the powers 0..2k of p.

Examples

			a(2) = 3 as there are three sets viz. {2}, {1,4}, {1,2,4}, each of which has geometric mean 2.
a(4) = 9: the nine sets are {4}, {1, 16}, {2, 8}, {1, 4, 16}, {2, 4, 8}, {1, 2, 32}, {1, 2, 4, 32}, {1, 2, 8, 16}, {1, 2, 4, 8, 16}.
		

Crossrefs

Cf. A066571.

Programs

  • Mathematica
    (* Recomputation using existing values and prime signatures *)
    a[1] = 1; a[n_] := Switch[ FactorInteger[n][[All, 2]] // Sort, {1}, 3, {2}, 9, {3}, 31, {4}, 117, {1, 1}, 255, {5}, 479, {1, 2}, 48891, {1, 3}, 12896331, {2, 2}, 668187863, {1, 4}, 3981060137, {1, 1, 1}, 329166915027, , 0]; Table[ a[n], {n, 1, 59}] (* _Jean-François Alcover, Sep 04 2013 *)

Extensions

More terms from Naohiro Nomoto, Dec 26 2001
More terms from Franklin T. Adams-Watters, Jun 09 2006
More terms from Jean-François Alcover, Sep 04 2013
Previous Showing 11-12 of 12 results.