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: Michael R Peake

Michael R Peake's wiki page.

Michael R Peake has authored 4 sequences.

A348378 Number of ways to reach n by starting with any positive integer, and repeatedly adding any positive integer or multiplying by any integer greater than 1.

Original entry on oeis.org

1, 3, 6, 15, 27, 63, 117, 252, 492, 1008, 1986, 4059, 8031, 16182, 32277, 64791, 129312, 259188, 517812, 1036677, 2072424, 4146714, 8291439, 16587276, 33170181, 66348369, 132689202, 265394223, 530772129, 1061577642, 2123121900, 4246308861, 8492554653
Offset: 1

Author

Michael R Peake, Jan 25 2022

Keywords

Examples

			For n = 3 the a(3) = 6 solutions are 3 = 1 + 2 = 2 + 1  = (1 + 1) + 1 = (1*2) + 1 = 1*3.
		

Crossrefs

Programs

  • MATLAB
    a(1)=1; for n=2:20, a(n)=1+sum(a(1:n-1))+sum(a(find(~rem(n,1:n-1)))); end;
    
  • Maple
    a:= proc(n) option remember; uses numtheory; 1+add(
          a(n-j), j=1..n-1)+add(a(n/d), d=divisors(n) minus {1})
        end:
    seq(a(n), n=1..33);  # Alois P. Heinz, Jan 25 2022
  • Mathematica
    a[n_] := a[n] = 1 + Sum[a[n-j], {j, 1, n-1}] +
         Sum[a[n/d], {d, Divisors[n] ~Complement~ {1}}];
    Table[a[n], {n, 1, 33}] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
  • PARI
    seq(n)={my(a=vector(n), s=0); for(n=1, n, a[n] = 1 + s + sumdiv(n, d, a[d]); s += a[n]); a} \\ Andrew Howroyd, Jan 25 2022
  • Python
    from functools import cache
    @cache
    def a(n): return 1 if n == 1 else 2 + sum(a(i) for i in range(1, n)) + sum(a(i) for i in range(2, n) if n%i == 0)
    print([a(n) for n in range(1, 35)]) # Michael S. Branicky, Jan 25 2022
    

Formula

a(n) = 1 + (Sum_{k=1..n-1} a(k)) + (Sum_{d|n, dAndrew Howroyd, Jan 25 2022

A348396 Number of ways to reach n by starting with 1 and repeatedly adding any positive integer or multiplying by any integer greater than 1.

Original entry on oeis.org

1, 2, 4, 10, 18, 42, 78, 168, 328, 672, 1324, 2706, 5354, 10788, 21518, 43194, 86208, 172792, 345208, 691118, 1381616, 2764476, 5527626, 11058184, 22113454, 44232246, 88459468, 176929482, 353848086, 707718428, 1415414600, 2830872574, 5661703102, 11323491086
Offset: 1

Author

Michael R Peake, Jan 25 2022

Keywords

Examples

			For n = 3 the a(3) = 4 solutions are 1 + 2, (1 + 1) + 1, (1*2) + 1, 1*3.
		

Crossrefs

Programs

  • MATLAB
    a(1)=1; for n=2:20, a(n)=sum(a(1:n-1))+sum(a(find(~rem(n,1:n-1)))); end;
    
  • Maple
    a:= proc(n) option remember; uses numtheory; `if`(n=1, 1,
          add(a(n-j), j=1..n-1)+add(a(n/d), d=divisors(n) minus {1}))
        end:
    seq(a(n), n=1..34);  # Alois P. Heinz, Jan 25 2022
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, Sum[a[n - j], {j, 1, n - 1}] +
         Sum[a[n/d], {d, Divisors[n] ~Complement~ {1}}]];
    Table[a[n], {n, 1, 34}] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
  • PARI
    seq(n)={my(a=vector(n), s=1); a[1]=s; for(n=2, n, a[n] = s + sumdiv(n, d, a[d]); s += a[n]); a} \\ Andrew Howroyd, Jan 25 2022
  • Python
    from functools import cache
    @cache
    def a(n): return 1 if n == 1 else 1 + sum(a(i) for i in range(1, n)) + sum(a(i) for i in range(2, n) if n%i == 0)
    print([a(n) for n in range(1, 34)]) # Michael S. Branicky, Jan 25 2022
    

A248970 Bases that lack a three-digit narcissistic number: numbers n with no 1 <= x < n, 0 <= y,z < n such that x^3 + y^3 + z^3 = n^2*x + n*y + z.

Original entry on oeis.org

72, 90, 108, 153, 270, 423, 450, 531, 558, 630, 648, 738, 1044, 1098, 1125, 1224, 1242, 1287, 1440, 1503, 1566, 1611, 1620, 1800, 1935, 2034, 2142, 2250, 2358, 2439, 2448, 2511, 2754, 2790, 2799, 2862, 2943, 2952
Offset: 1

Author

Michael R Peake, Oct 18 2014

Keywords

Comments

All terms are multiples of 9.

Examples

			17=1^3+2^3+2^3 is 122 in base 3, so 3 is not in the sequence.
		

Crossrefs

Cf. A005188 (base 10).

Programs

  • MATLAB
    for Base=1:100,Noneyet=1;for a=1:Base-1,for b=0:Base-1,for c=0:Base-1,if a*Base*Base+b*Base+c==a^3+b^3+c^3,Noneyet = 0;end;end;end;end;if Noneyet,disp(Base);end;end;
    
  • PARI
    is(n)=if(n%9,return(0)); for(x=1,n-1,for(y=0,x,for(z=0,y, my(v=digits(x^3+y^3+z^3,n)); if(vecsort(v)==[z,y,x],return(0))))); 1 \\ slow; Charles R Greathouse IV, Oct 21 2014
    
  • PARI
    is(n)=if(n%9,return(0)); my(mx=n*(n-1)*(n-2),t); for(x=1,n-1,for(y=0,n-1, t=n*(n*x+y)-x^3-y^3; if(t>=0 && t <= mx && !polisirreducible('z^3-'z-t) && #select(P->poldegree(P)==1&&polcoeff(P,0)<=0 && polcoeff(P,0)>-n, factor('z^3-'z-t)[,1]), return(0)))); 1 \\ faster; Charles R Greathouse IV, Oct 21 2014

Extensions

a(26)-a(38) from Charles R Greathouse IV, Oct 21 2014

A174525 Bases N in which ab and ba are different squares, for some a and b.

Original entry on oeis.org

9, 12, 17, 19, 24, 25, 28, 33, 40, 49, 51, 52, 57, 60, 64, 67, 72, 73, 79, 81, 84, 88, 89, 96, 97, 99, 103, 105, 108, 112, 115, 116, 121, 124, 129, 134, 136, 144, 145, 148, 156, 161, 163, 168, 169, 172, 177, 180, 184, 192, 193, 199
Offset: 1

Author

Michael R Peake, Mar 21 2010

Keywords

Comments

From Robert Israel, Mar 14 2016: (Start)
Leading 0's are not allowed.
Conjecture: all odd squares (A016754) except 1 are terms of the sequence. (End)
N=(2n+1)^2, a=n^2, b=4n^2+2n+1 shows that (2n+1)^2 is a term, so this sequence is infinite. - Michael R Peake, Mar 21 2017

Examples

			17_9 and 71_9 are squares. 14_12 and 41_12 are squares.
		

Crossrefs

Cf. A016754.

Programs

  • MATLAB
    Match = zeros(1,100);
    for N=2:200, Tens=zeros(1,N-1);Units=zeros(1,N-1); for a=N-1:-1:sqrt(N),c=a^2;Tens(a)=floor(c/N);Units(a)=rem(c,N);end; for a=N-1:-1:sqrt(N),h=find((Units==Tens(a))&([1:N-1]~=a)); if length(h),Match=any(Units(a)==Tens(h)); if Match,Sol(N)=Sol(N)+1;end;end;end;end;
    find(Match > 0)
  • Maple
    filter:= proc(n) local x,a,b,R;
        for x from ceil(sqrt(n)) to n-1 do
          a:= x^2 mod n;
          if a=0 then next fi;
          b:= (x^2-a)/n;
          if assigned(R[b,a]) then return true fi;
          R[a,b]:= 1;
        od;
        false
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Mar 14 2016

Extensions

MATLAB program corrected by Robert Israel, Mar 14 2016