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.

A167615 Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares.

Original entry on oeis.org

1, 15, 165, 1665, 16664, 166664, 1666663, 16666663, 166666661, 1666666662, 16666666661, 166666666660, 1666666666661, 16666666666660, 166666666666659, 1666666666666660, 16666666666666658, 166666666666666657, 1666666666666666660, 16666666666666666656
Offset: 1

Views

Author

Martin Renner, Jan 18 2011

Keywords

Comments

A049416(n) + A180416(n) + A180425(n) + a(n) = A002283(n).

Examples

			a(1) = 1 since 7 is the only natural number below 10 which is the sum of 4 but no fewer nonzero squares.
		

Crossrefs

Cf. A004215.

Programs

  • Maple
    a:=proc(n)
      local f,s,k;
      f:=(x,y)->ceil(10^y/2^(2*x+3)-7/8):
      s:=0:
      for k from 0 by 1 while not f(k,n)=0 do
        s:=s+f(k,n);
      od:
      return(s);
    end;
  • Mathematica
    a[n_] := Module[{f, s = 0, k}, f[x_, y_] := Ceiling[10^y/2^(2x+3) - 7/8]; For[k = 0, f[k, n] != 0, k++, s += f[k, n]]; Return[s]];
    Array[a, 20] (* Jean-François Alcover, Oct 31 2020, after Maple *)

Formula

a(n) = Sum_{i=0..k} ceiling(10^n/2^(2*i+3) - 7/8) with minimal k for which ceiling(10^n/2^(2*k+3) - 7/8) = 0.