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.

Showing 1-10 of 10 results.

A051847 Bisection of A051846, divided by the term position.

Original entry on oeis.org

1, 19, 1493, 293479, 109739369, 66987982331, 60693710471869, 76519827268721103, 128138108936443028945, 275176672984400058317539, 737345594135016860806925221, 2411620538399461719230688945719
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Crossrefs

Formula

a(n) = A051846(2n-1)/(2n-1).
a(n) = A221740(2n-1). - Alexander R. Povolotsky, Oct 13 2022

A328290 Table T(b,n) = #{ k > 0 | nk has only distinct and nonzero digits in base b }, b >= 2, 1 <= n <= A051846(b).

Original entry on oeis.org

1, 4, 1, 0, 0, 1, 0, 1, 15, 5, 9, 0, 2, 3, 2, 0, 4, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 64, 42, 21, 9, 0, 14, 8, 4, 7, 0, 6, 4, 3, 6, 0, 3, 2, 5, 2, 0, 4, 5, 3, 2, 0, 0, 2, 1, 2, 0, 2, 1, 2, 1, 0, 1, 2, 1, 2, 0, 1, 3, 1, 1, 0, 1, 1, 2, 1, 0, 0, 0, 0, 2
Offset: 2

Views

Author

M. F. Hasler, Oct 11 2019

Keywords

Comments

The table could also be considered as an infinite square array with T(b,n) = 0 for n > A051846(b) = the largest pandigital number in base b.
Can anyone find a simple formula for the index of the last terms > 1 in each row b?

Examples

			The table reads:  (column n >= 2 corresponds to the base)
   B \ n = 1      2      3      4      5      6      7     8      9      10  ...
   2       1     (0 ...)
   3       4      1      0      0      1      0      1    (0 ...)
   4      15      5      9      0      2      3      2     0      4       1  ...
   5      64     42     21      9      0     14      8     4      7       0  ...
   6     325    130     65     65    161      0     48    23     32      66  ...
   7    1956    651   1140    319    386    221      0   156    362     128  ...
   8   13699   5871   4506   1957   2748   1944   6277     0   1470    1189  ...
   9  109600  73588  27400  56930  21973  18397  15641  8305      0   14826  ...
  10  986409 438404 572175 219202 109601 255752 140515 109601 432645     0   ...
  (...)
In base 2, 1 is the only number with distinct nonzero digits, so T(2,1) = 1, T(2,n) = 0 for n > 1.
In base 3, {1, 2, 12_3 = 5, 21_3 = 7} are the only numbers with distinct nonzero digits, so T(3,1) = 4, T(3,2) = T(3,7) = T(3,7) = 1, T(3,n) = 0 for n > 7.
In base 4, {1, 2, 3, 12_4 = 6, 13_4 = 7, 21_4 = 9, ..., 321_4 = 57} are the only numbers with distinct nonzero digits, so T(4,n) = 0 for n > 57.
		

Crossrefs

Cf. A328287 (row 10), A328288, A328277.
Column 1 is A007526 (number of nonnull variations of n distinct objects).

Programs

  • PARI
    T(B,n)={my(S,T,U); for(L=1,B-1,T=vectorv(L,k,B^(k-1)); forperm(L,p, U=vecextract(T,p); forvec(D=vector(L,i,[1,B-1]),D*U%n||S++,2)));S}

Formula

T(b,b) = 0, since any multiple of b has a trailing digit 0 in base b.
T(b,A051846(b)) = 1 and T(b,n) = 0 for n > A051846(b) = (b-1)(b-2)..21 in base b.

A023811 Largest metadrome (number with digits in strict ascending order) in base n.

Original entry on oeis.org

0, 1, 5, 27, 194, 1865, 22875, 342391, 6053444, 123456789, 2853116705, 73686780563, 2103299351334, 65751519677857, 2234152501943159, 81985529216486895, 3231407272993502984, 136146740744970718253, 6106233505124424657789, 290464265927977839335179
Offset: 1

Views

Author

Keywords

Comments

Also smallest zeroless pandigital number in base n. - Franklin T. Adams-Watters, Nov 15 2006
The smallest permutational number in A134640 in the n-positional system. - Artur Jasinski, Nov 07 2007

Examples

			a(5) = 1234[5] (in base 5) = 1*5^3 + 2*5^2 + 3*5 + 4 = 125 + 50 + 15 + 4 = 194.
a(10) = 123456789 (in base 10).
		

Crossrefs

Programs

  • Haskell
    a023811 n = foldl (\val dig -> val * n + dig) 0 [0 .. n - 1]
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Magma
    [0] cat [(n^n-n^2+n-1)/(n-1)^2: n in [2..20]]; // Vincenzo Librandi, May 22 2012
    
  • Maple
    0, seq((n^n-n^2+n-1)/(n-1)^2, n=2..100); # Robert Israel, Dec 13 2015
  • Mathematica
    Table[Total[(#1 n^#2) & @@@ Transpose@ {Range[n - 1], Reverse@ (Range[n - 1] - 1)}], {n, 20}] (* Michael De Vlieger, Jul 24 2015 *)
    Table[Sum[(b - k)*b^(k - 1), {k, b - 1}], {b, 30}] (* Clark Kimberling, Aug 22 2015 *)
    Table[FromDigits[Range[0, n - 1], n], {n, 20}] (* L. Edson Jeffery, Dec 13 2015 *)
  • PARI
    {for(i=1,18,cuo=0; for(j=1,i-1,cuo=cuo+j*i^(i-j-1)); print1(cuo,", "))} \\\ Douglas Latimer, May 16 2012
    
  • PARI
    A023811(n)=if(n>1,(n^n-n^2)\(n-1)^2+1)  \\ M. F. Hasler, Jan 22 2013
    
  • Python
    def a(n): return (n**n - n**2 + n - 1)//((n - 1)**2) if n > 1 else 0
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 24 2023

Formula

a(n) = Sum_{j=1...n-1} j*n^(n-1-j).
lim_{n->infinity} a(n)/a(n-1) - a(n-1)/a(n-2) = exp(1). - Conjectured by Gerald McGarvey, Sep 26 2004. Follows from the formula below and lim_{n->infinity} (1+1/n)^n = e. - Franklin T. Adams-Watters, Jan 25 2010
a(n) = (n^n-n^2+n-1)/(n-1)^2 = A058128(n)-1 = n*A060073(n)-1 (for n>=2). - Henry Bottomley, Feb 21 2001

Extensions

Edited by M. F. Hasler, Jan 22 2013

A051845 Triangle T(n,k) read by rows, in which row n gives all permutations of digits 1..n interpreted in base n+1.

Original entry on oeis.org

1, 5, 7, 27, 30, 39, 45, 54, 57, 194, 198, 214, 222, 238, 242, 294, 298, 334, 346, 358, 366, 414, 422, 434, 446, 482, 486, 538, 542, 558, 566, 582, 586, 1865, 1870, 1895, 1905, 1930, 1935, 2045, 2050, 2105, 2120, 2140, 2150, 2255, 2265, 2285, 2300, 2355, 2360
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Comments

All terms in any odd row 2m+1 are divisible by 2m+1
The n-th row has n! elements.
Variant of permutational numbers with shifted digits 0->1->2->...->p+1 in p+1 positional system -- see A134750. - Artur Jasinski, Nov 08 2007
From Alexander R. Povolotsky, Oct 22 2022: (Start)
All terms in any even-indexed row n=2m are divisible by m, where m>0.
Row n starts with T(n,1) = ((n+1)^(n+1)-n^2-n-1)/n^2 = A023811(n+1).
Row n ends with T(n,n!) = ((n+1)^(n+1)*(n-1)+1)/n^2 = A051846(n).
(End)

Examples

			Triangle begins:
         k=1   k=2   k=3  ...
  n=1:     1;
  n=2      5,    7;
  n=3:    27,   30,  ...,   57;
  n=4:   194,  198,  214,  ..., 586;
  n=5:  1865, 1870, 1905, 1930, ..., 7465;
E.g., the permutations of digits 1, 2 and 3 in lexicographic order are 123, 132, 213, 231, 312, 321, which interpreted in base 4 give the third row of the table: 27, 30, 39, 45, 54, 57.
		

Crossrefs

Left edge = A023811, right edge = A051846.

Programs

  • Maple
    with(combinat,permute); compute_u_rows := proc(u) local a,n; a := []; for n from 1 to u do a := [op(a),op(map(list_in_base_b,permute(n),(n+1)))]; od; RETURN(a); end; list_in_base_b := proc(l,b) local k; add(l[nops(l)-k]*(b^k), k=0..(nops(l)-1)); end;
  • Mathematica
    a = {}; b = {}; Do[AppendTo[b, n]; w = Permutations[b]; Do[j = FromDigits[1 + w[[m]], n + 2]; AppendTo[a, j], {m, 1, Length[w]}], {n, 0, 5}]; a (* Artur Jasinski, Nov 08 2007 *)
  • Python
    from itertools import permutations
    def fd(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
    def row(n): return [fd(d, n+1) for d in permutations(range(1, n+1))]
    print([an for r in range(1, 6) for an in row(r)]) # Michael S. Branicky, Oct 21 2022

A221740 a(n) = -4*((n-1)*(n+1)^(n+1)+1)/(((-1)^n-3)*n^3).

Original entry on oeis.org

1, 7, 19, 293, 1493, 38127, 293479, 10593529, 109739369, 5135610071, 66987982331, 3856048810781, 60693710471869, 4149140360751583, 76519827268721103, 6058888636862818097, 128138108936443028945, 11533996620790579909159
Offset: 1

Views

Author

Keywords

Comments

Per exhaustive program, written for bases from 2 to 10, the number of permutations pairs, which have the same ratio, equal to A221740(n)/A221741(n) = (n^2*(n+1)^n - (n+1)^n + 1) / (-n^2 + n*(n+1)^n + (n+1)^n - n - 1), is: {2,2,3,3,5,3,7,5,7,...} for n >= 1 where n = r-1 and r is the base radix. Judging by above sequence it appears that the number of such permutations pairs is related to phi, which is the Euler totient function - according to A039649, A039650, A214288 (see bullet 1 of the analysis in the answer section of the Mathematics StackExchange link). - Alexander R. Povolotsky, Jan 26 2013

Crossrefs

Programs

  • Mathematica
    Table[-4*((n - 1)*(n + 1)^(n + 1) + 1)/(((-1)^n - 3)*n^3), {n,1,50}] (* G. C. Greubel, Feb 19 2017 *)
  • Maxima
    makelist(-4*((n-1)*(n+1)^(n+1)+1)/(((-1)^n-3)*n^3),n,1,20); /* Martin Ettl, Jan 25 2013 */
    
  • PARI
    for(n=1,25, print1(-4*((n - 1)*(n + 1)^(n + 1) + 1)/(((-1)^n - 3)*n^3), ", ")) \\ G. C. Greubel, Feb 19 2017

Formula

a(n) = -4*A051846(n)/((-3 + (-1)^n)*n).
From Alexander R. Povolotsky, Oct 12 2022: (Start)
floor(a(n+1)/A221741(n+1)) = n.
Limit_{n->oo} (a(n)/A221741(n) - floor(a(n)/A221741(n))) = 0. (End)

A370371 Largest m such that any two consecutive digits of the base-n expansion of m^2 differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

1, 1, 15, 2, 195, 867, 3213, 18858, 99066, 528905, 2950717, 294699, 105011842, 659854601, 4285181505, 1578809181, 198009443151, 1404390324525, 10225782424031, 3635290739033, 583655347579584, 4564790605900107, 36485812146621733, 297764406866494254, 2479167155959358950
Offset: 2

Views

Author

Jianing Song, Feb 16 2024

Keywords

Comments

By definition, a(n) <= sqrt(Sum_{i=0..n-1} i*n^i) = sqrt(A062813(n)). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= sqrt(Sum_{i=1..n-1} i*n^(i-1)) = sqrt(A051846(n-1)); see A258103.
If n is odd and n-1 has an even 2-adic valuation, then a(n) <= sqrt(Sum_{i=2..n-1} i*n^(i-2)); see A258103. - Chai Wah Wu, Feb 25 2024

Examples

			Base 4: 15^2 = 225 = 3201_4;
Base 6: 195^2 = 38025 = 452013_6;
Base 7: 867^2 = 751689 = 6250341_7;
Base 8: 3213^2 = 10323369 = 47302651_8;
Base 9: 18858^2 = 355624164 = 823146570_9;
Base 10: 99066^2 = 9814072356;
Base 11: 528905^2 = 279740499025 = A8701245369_11;
Base 12: 2950717^2 = 8706730814089 = B8750A649321_12;
Base 13: 294699^2 = 86847500601 = 8260975314_13.
		

Crossrefs

Cf. A215014, A370362, A370370, A258103 (number of pandigital squares in base n).
The actual squares are given by A370611.

Programs

  • PARI
    isconsecutive(m,n)=my(v=vecsort(digits(m,n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k,n) == 1 if and only if any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order
    a(n) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2,n), return(m)))
    
  • Python
    from math import isqrt
    from sympy import multiplicity
    from sympy.ntheory import digits
    def a(n):
        ub = isqrt(sum(i*n**i for i in range(n)))
        if n%2 == 1 and multiplicity(2, n-1)%2 == 0:
            ub = isqrt(sum(i*n**(i-2) for i in range(2, n)))
        return(next(i for i in range(ub, -1, -1) if len(d:=sorted(digits(i*i, n)[1:])) == d[-1]-d[0]+1 == len(set(d))))
    print([a(n) for n in range(2, 13)]) # Michael S. Branicky, Feb 23 2024

Extensions

a(17)-a(20) and a(22)-a(26) from Michael S. Branicky, Feb 23 2024
a(21) from Chai Wah Wu, Feb 25 2024

A189001 a(n) = Sum_{i=0..n} (i+1)*n^i.

Original entry on oeis.org

1, 3, 17, 142, 1593, 22461, 380713, 7526268, 169826513, 4303999495, 120987654321, 3734729768298, 125562274081225, 4566262891748481, 178581127445062553, 7473240118999870456, 333189190735802745633, 15766036084935301064139
Offset: 0

Views

Author

Bruno Berselli, Apr 15 2011

Keywords

Examples

			a(4) = 1593  because  1593 = 1+2*4+3*4^2+4*4^3+5*4^4.
		

Crossrefs

Cf. A189122: Sum_{i=0..n} (i+1)^2*n^i.

Programs

  • Magma
    [&+[(k+1)*n^k: k in [0..n]]: n in [0..17]];
  • Mathematica
    Join[{1, 3}, Table[(((n^2 - 2) n^(n + 1) + 1) / (n - 1)^2), {n, 2, 20}]] (* Vincenzo Librandi, Aug 19 2013 *)

Formula

a(n) = ((n^2-2)*n^(n+1)+1)/(n-1)^2 for n > 1; a(0)=1, a(1)=3.

A370611 Largest square such that any two consecutive digits of its base-n expansion differ by 1 after arranging the digits in decreasing order.

Original entry on oeis.org

1, 1, 225, 4, 38025, 751689, 10323369, 355624164, 9814072356, 279740499025, 8706730814089, 86847500601, 11027486960232964, 435408094460869201, 18362780530794065025, 2492638430009890761, 39207739576969100808801, 1972312183619434816475625, 104566626183621314286288961, 13215338757299095309775089
Offset: 2

Views

Author

Jianing Song, Feb 23 2024

Keywords

Comments

By definition, a(n) <= Sum_{i=0..n-1} i*n^i = A062813(n). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= Sum_{i=1..n-1} i*n^(i-1) = A051846(n-1); see A258103.
If n is odd and n-1 has an even 2-adic valuation, then a(n) <= Sum_{i=2..n-1} i*n^(i-2); see A258103. - Chai Wah Wu, Feb 25 2024

Examples

			See the Example section of A370371.
		

Crossrefs

Cf. A215014, A370370, A370610, A258103 (number of pandigital squares in base n).
The square roots are given by A370371.

Programs

  • PARI
    isconsecutive(m, n)=my(v=vecsort(digits(m, n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, n) == 1 if and only if any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order
    a(n) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2, n), return(m^2)))

Extensions

a(17)-a(20) from Michael S. Branicky, Feb 23 2024
a(21) from Chai Wah Wu, Feb 25 2024

A363365 Array read by ascending antidiagonals: A(1, k) = k; for n > 1, A(n, k) = (k + 1)*A(n-1, k) + k + 1 - n, with k > 0.

Original entry on oeis.org

1, 2, 2, 3, 7, 3, 4, 21, 14, 4, 5, 62, 57, 23, 5, 6, 184, 228, 117, 34, 6, 7, 549, 911, 586, 207, 47, 7, 8, 1643, 3642, 2930, 1244, 333, 62, 8, 9, 4924, 14565, 14649, 7465, 2334, 501, 79, 9, 10, 14766, 58256, 73243, 44790, 16340, 4012, 717, 98, 10
Offset: 1

Views

Author

Stefano Spezia, May 29 2023

Keywords

Examples

			The array begins:
  1,   2,    3,     4,     5, ...
  2,   7,   14,    23,    34, ...
  3,  21,   57,   117,   207, ...
  4,  62,  228,   586,  1244, ...
  5, 184,  911,  2930,  7465, ...
  6, 549, 3642, 14649, 44790, ...
  ...
		

Crossrefs

Cf. A000027 (n=1 or k=1), A008865, A051846 (diagonal), A064017 (k=9), A353094 (k=2), A353095 (k=3), A353096 (k=4), A353097 (k=5), A353098 (k=6), A353099 (k=7), A353100 (k=8), A363366 (antidiagonal sums).

Programs

  • Mathematica
    A[n_,k_]:=((k-1)*(k+1)^(n+1)+k*n-k^2+1)/k^2; Table[A[n-k+1,k],{n,10},{k,n}]//Flatten (* or *)
    A[n_,k_]:=SeriesCoefficient[x*(k-(k+1)*x)/((1-x)^2*(1-(k+1)*x)),{x,0,n}]; Table[A[n-k+1,k],{n,10},{k,n}]//Flatten (* or *)
    A[n_,k_]:=n!SeriesCoefficient[Exp[x]((k^2-1)(Exp[k x]-1)+k x)/k^2,{x,0,n}]; Table[A[n-k+1,k],{n,10},{k,n}]//Flatten

Formula

A(n, k) = ((k - 1)*(k + 1)^(n+1) + k*n - k^2 + 1)/k^2.
O.g.f. of k-th column: x*(k - (k + 1)*x)/((1 - x)^2*(1 - (k + 1)*x)).
E.g.f. of k-th column: exp(x)*((k^2 - 1)*(exp(k*x) - 1) + k*x)/k^2.
A(2, n) = A008865(n+1).

A370671 a(n) = Sum_{i=2..n-1} i*n^(i-2).

Original entry on oeis.org

0, 0, 0, 2, 14, 117, 1244, 16340, 256794, 4708235, 98765432, 2334368214, 61405650470, 1779714835745, 56358445438164, 1936265501684072, 71737338064426034, 2851241711464855575, 121019325106640638448, 5463472083532379956970, 261417839335180055401662, 13215375398730198560266829
Offset: 0

Views

Author

Chai Wah Wu, Feb 25 2024

Keywords

Comments

Digits 2..(n-1) in strict descending order (n-1)..2 interpreted in base n.
Upper bound of A370371(n) when n is odd and n-1 has an even 2-adic valuation.

Crossrefs

Programs

  • Python
    def A370671(n): return (n-2)*(n**(n-1)-1)//(n-1)**2 if n > 1 else 0

Formula

a(n) = (n - 2)*(n^(n - 1) - 1)/(n - 1)^2 for n > 1.
Showing 1-10 of 10 results.