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: Paul Richards

Paul Richards's wiki page.

Paul Richards has authored 10 sequences.

A260372 Number of haystack arrangements with n bales.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 3, 2, 4, 2, 3, 2, 4, 1, 5, 2, 2, 3, 4, 3, 4, 2, 4, 3, 5, 1, 6, 3, 2, 3, 5, 1, 6, 3, 5, 3, 4, 2, 5, 3, 3, 3, 6, 2, 8, 2, 3, 4, 5, 3, 7, 2, 3, 3, 8, 2, 5, 4, 4, 4, 4, 2, 8, 2, 6, 2, 7, 2, 7, 3, 3, 5, 5, 1, 8, 4, 3, 5, 6, 4, 7, 2, 6, 2, 8, 3, 7, 3, 3, 5, 7, 1, 8, 3, 7
Offset: 1

Author

Paul Richards, Aug 29 2015

Keywords

Comments

A popular way of arranging cylindrical bales of hay is for the first row to be a rectangle with dimensions (x,y), and the next row to be (x-1, y-1), and so on. The height is h where h<=min(x,y). This sequence gives the number of distinct (y>=x) arrangements which result in n bales.

Examples

			a(14)=4 since there are 4 haystacks with 14 bales: (x=3,x=3,h=3), (x=2,x=5,h=2), (x=2,y=7,h=1), (x=1,y=14,h=1).
		

Programs

  • PARI
    s(x,y,h) = h*(6*x*y-3*(x+y)*(h-1) + (h-1)*(2*h-1))/6 ;
    a(n) = my(nbc); for (y=1, n, for(x=1, y, for (h=0, min (x,y), if (s(x,y,h) == n, nbc++)))); nbc; \\ Michel Marcus, Apr 30 2016

Formula

The size of the haystack s(x,y,h) = h(6xy-3(x+y)(h-1) + (h-1)(2h-1))/6 (courtesy of Sascha Troscheit).

A243981 Minimum range of sets of natural numbers with a product of n.

Original entry on oeis.org

1, 2, 0, 4, 1, 6, 0, 0, 3, 10, 1, 12, 5, 2, 0, 16, 1, 18, 1, 4, 9, 22, 1, 0, 11, 0, 3, 28, 1, 30, 0, 8, 15, 2, 0, 36, 17, 10, 3, 40, 1, 42, 7, 2, 21, 46, 1, 0, 3, 14, 9, 52, 1, 6, 1, 16, 27, 58, 2, 60, 29, 2, 0, 8, 5, 66, 13, 20, 3, 70, 1, 72, 35, 2, 15, 4, 7, 78, 1, 0, 39, 82, 4, 12, 41, 26, 3, 88, 1, 6, 19, 28, 45, 14, 1, 96, 5, 2, 0
Offset: 2

Author

Paul Richards, Nov 11 2014

Keywords

Comments

The minimum difference between the largest and smallest values in the sets of positive integers with a product of n, excluding the singleton set {n}.

Examples

			For 45 the sets are {1,45}, {3,15}, {5,9}, {3,3,5} with differences of 44, 12, 4 and 2 respectively.  2 is the minimum and so a(45) = 2.
		

Crossrefs

Formula

a(n) <= A046665(n) for all composite n, a(p) = p - 1 for primes p. - Charlie Neder, Jan 13 2019

A185867 Numbers m whose decimal digits are a subsequence of the decimal digits of k*m for some 1 < k < 10.

Original entry on oeis.org

2, 4, 5, 6, 8, 15, 18, 20, 25, 35, 40, 45, 50, 60, 75, 80, 125, 150, 175, 180, 200, 225, 250, 275, 350, 375, 400, 450, 475, 500, 575, 600, 625, 675, 750, 800, 875, 1125, 1250, 1375, 1500, 1625, 1750, 1800, 1875
Offset: 1

Author

Paul Richards, Feb 05 2011

Keywords

Comments

Are there finitely many non-multiples of 10 in this sequence? a(72) = 7875 seems to be the last one. - Charles R Greathouse IV, Feb 08 2011

Examples

			15 is a term because 15*7 = 105, and 105 can be formed from 15 by inserting the digit 0 in the middle.
		

Programs

  • PARI
    sub(v,u)=my(j=1);if(#v==#u,return(0));for(i=1, #v, if(v[i]!=u[j],if(i!=j,return(0)),j++));1
    isA185867(n)=my(N=eval(Vec(Str(n))));for(k=2, 9, if(sub(eval(Vec(Str(n*k))),N),return(k)));0

Extensions

Program and a(22)-a(45) from Charles R Greathouse IV, Feb 08 2011

A133139 Number of generalized Ulam sequences including n as the third or higher term.

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 6, 10, 9, 12, 14, 17, 20, 20, 20, 29, 28, 31, 35, 35, 37, 40, 45, 51, 49, 55, 55, 58, 64, 61, 71, 76, 74, 76, 78, 87, 92, 91, 99, 97, 107, 100, 114, 107, 112, 119, 128, 132, 133, 127, 142, 140, 151, 146, 151, 154, 170, 158, 172, 164, 185, 179, 184, 186
Offset: 1

Author

Paul Richards, Sep 21 2007

Keywords

Comments

I generalize the Ulam sequence by allowing any positive integer values (i and j) for the first two terms. Subsequent terms are all those integers which are a unique sum of two distinct earlier terms. In this sequence, a(n) is the number of distinct sequences (as defined by the first two terms) where 1 <= i < n-1 and i < j <= n-1.

Examples

			a(10) = 12, since 10 occurs as a term in 12 different generalized Ulam sequences. The first two values of each are: (1,3) (1,4) (1,5) (1,6) (1,7) (1,8) (1,9) (2,6) (2,8) (3,4) (3,7) (4,6). It does not occur in the sequence (1,2) which runs: 1, 2, 3, 4, 6, 8, 11...
		

Crossrefs

Cf. A002858.

Programs

  • C
    See Links section.

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A125508 Lowest number having a particular shape of factor decomposition binary tree.

Original entry on oeis.org

1, 2, 4, 8, 16, 20, 32, 40, 64, 72, 88, 128, 160, 176, 200, 220, 256, 272, 288, 320, 336, 360, 400, 420, 460, 480, 512, 540, 544, 640, 704, 864, 880, 920, 1024, 1056, 1152, 1184, 1200, 1280, 1344, 1440, 1600, 1640, 1680, 1800, 1840, 1920, 2048, 2176, 2368
Offset: 1

Author

Paul Richards, Jan 18 2007

Keywords

Comments

For a natural number, n, make it the root node of a binary tree. The left child node (L) is the largest divisor of n which is greater than 1 but less than or equal to the square root of n, if this exists. The right child node is n/L, if the left node exists. Thus if n is a prime it is a leaf node; otherwise if it is composite then it is the product of its two children. If n = 1 then we have an empty tree. A term in this sequence a(n) is such that no number (x) exists 1<=x

Examples

			a(8) = 40, make this the root node.
40 is first decomposed into 5 and 8; 5 is a leaf node.
8 is decomposed into 2 and 4; 2 is a leaf node.
4 is decomposed into 2 and 2; both are leaf nodes.
There is no number x (where 1 <= x < 40) which has a factor decomposition binary tree isomorphic to this.
		

Programs

  • PARI
    fissr(n) = {if (isprime(n), n, my(d = divisors(n)); my(nddt = #d\2 + 1); if (#d % 2, [fissr(d[nddt]),n,fissr(d[nddt])], [fissr(d[nddt-1]),n,fissr(d[nddt])]););}
    fiss(n) = if (n==1, [], if (type(fv = fissr(n))== "t_INT", [fv], fv));
    empty(v) = {my(nv = vector(#v)); for (i=1, #v, if (type(v[i]) == "t_INT", nv[i] = 0, nv[i] = empty(v[i]));); nv;}
    eqvec(va, vb) = {if (type(va) != type(vb), return (0)); if (type(va) == "t_INT", return (va == vb)); if (#va != #vb, return (0)); for (i=1, #va, if (!eqvec(va[i], vb[i]), return (0));); return (1);}
    isalready(erep, vrep) = {if (! #vrep, return (0)); for (j=1, #vrep, if (eqvec(erep, vrep[j]), return (1););); return (0);}
    addrep(erep, vrep) = {nvrep = vector(#vrep+1, i, if (i <= #vrep, vrep[i], 0)); nvrep[#vrep+1] = erep; nvrep;}
    lista(nn) = {vrep = []; for (n=1, nn, rep = fiss(n); erep = empty(rep); if (! isalready(erep, vrep), print1(n, ", "); vrep = addrep(erep, vrep);););} \\ Michel Marcus, May 25 2014

A130052 Numbers that are the sum of one or more consecutive squares in more than one way.

Original entry on oeis.org

25, 365, 841, 1405, 1730, 2030, 3281, 3655, 3740, 4510, 4705, 4760, 4900, 5244, 5434, 5915, 5929, 7230, 7574, 8415, 8464, 9385, 11055, 11236, 11900, 12325, 12524, 14905, 16745, 17484, 18879, 19005, 19044, 19855, 20449, 20510, 21790, 22806, 23681
Offset: 1

Author

Paul Richards, May 03 2007

Keywords

Examples

			25 = 3^2 + 4^2 = 5^2.
365 = 10^2 + 11^2 + 12^2 = 13^2 + 14^2.
		

Crossrefs

Cf. A059255 (subsequence).

Programs

  • PARI
    ok(n) = {my(i=sqrtint(n), m=0); while(i>0&&m<2, my(a=i^2, j=i); while(j>0&&a<=n, if(a==n, m+=1); j-=1; a=a+j^2); i-=1); return(m>1)}
    {for(p=1, 24000, if(ok(p), print1(p,", ")))} \\ Antonio Roldán, Mar 09 2020

Extensions

Extended by Ray Chandler, May 04 2007

A126688 Lowest base in which n has distinct digits.

Original entry on oeis.org

2, 2, 3, 4, 3, 3, 3, 4, 4, 5, 3, 4, 4, 4, 3, 5, 5, 4, 3, 5, 3, 5, 5, 4, 6, 6, 4, 4, 5, 4, 6, 6, 4, 6, 4, 4, 7, 5, 4, 5, 6, 5, 7, 4, 4, 7, 5, 5, 4, 4, 5, 4, 5, 4, 5, 4, 4, 5, 5, 6, 8, 6, 6, 9, 5, 5, 7, 6, 5, 5, 5, 7, 5, 7, 4, 5, 5, 4, 5, 5, 6, 5, 6, 5, 5, 5, 7, 7, 5, 6, 6, 8, 7, 6, 5, 5, 5, 8, 4, 11
Offset: 1

Author

Paul Richards, Feb 15 2007

Keywords

Comments

Start with binary and work upwards, expressing n in the given base (2,3,4... b). The term a(n)=b is the lowest base in which no two digits in n are the same.
See A123699 for another version of the same sequence. - R. J. Mathar, Jun 15 2008

Examples

			75 is 1001011 in binary (base 2), 2210 in base 3 and 1023 in base 4. So a(75) = 4 since 1023 has distinct digits (and neither 1001011 nor 2210 do).
		

Crossrefs

Cf. A010784 (base 10), A062813 (gives lower bound for a term).

Programs

  • Mathematica
    Table[ b=1;Until[Length[Union[IntegerDigits[n,b]]]==Length[IntegerDigits[n,b]],b++];b,{n,100}] (* James C. McMahon, Dec 26 2024 *)

A126071 Number of bases (2 <= b <= n+1) in which n is a palindrome.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 4, 4, 4, 2, 4, 5, 3, 3, 5, 3, 5, 4, 5, 3, 4, 4, 4, 4, 4, 3, 6, 3, 4, 3, 6, 3, 5, 3, 4, 5, 5, 2, 6, 3, 5, 5, 6, 2, 5, 5, 5, 5, 3, 3, 7, 3, 4, 6, 5, 6, 5, 4, 5, 3, 5, 3, 7, 4, 4, 4, 4, 3, 7, 2, 8, 4, 5, 3, 7, 6, 4, 3
Offset: 1

Author

Paul Richards, Mar 01 2007

Keywords

Comments

a(n) >= 1, since n will always have a single "digit" in base n+1.

Examples

			From bases 2 to 9 respectively, 8 can be represented as: 1000, 22, 20, 13, 12, 11, 10, 8. Three of those are symmetrical (22, 11, 8) and so a(8) = 3.
		

Crossrefs

Cf. A016026.
Cf. A016038, A047811 (related to numbers having 2 bases).

Programs

Extensions

Extended by T. D. Noe, Oct 04 2012

A124097 Numbers which are "easy" to key on a standard telephone keypad.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 21, 22, 23, 24, 25, 26, 32, 33, 35, 36, 41, 42, 44, 45, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 66, 68, 69, 70, 74, 75, 77, 78, 80, 84, 85, 86, 87, 88, 89, 90, 95, 96, 98, 99, 111, 112, 114, 115, 121, 122, 123, 124
Offset: 1

Author

Paul Richards, Dec 12 2006

Keywords

Comments

On a standard telephone keypad, i.e. 123 | 456 | 789 | 0, a number is "easy" to key in if each adjacent pair of digits in the number are the same, or are adjacent - either horizontally or vertically or diagonally. For example, adjacent to the 2 key are 1 and 3 (horizontal), 5 (vertical) and 4 and 6 (diagonal) so any of these digits could come after a 2 (but not 7, 8, 9 or 0).

Examples

			126 is a term since the 1 and 2 keys are adjacent and the 6 is diagonally adjacent to the 2.
		

A121315 Products of two consecutive prime powers.

Original entry on oeis.org

2, 6, 12, 20, 35, 56, 72, 99, 143, 208, 272, 323, 437, 575, 675, 783, 899, 992, 1184, 1517, 1763, 2021, 2303, 2597, 3127, 3599, 3904, 4288, 4757, 5183, 5767, 6399, 6723, 7387, 8633, 9797, 10403, 11021, 11663, 12317, 13673, 15125, 15875, 16256, 16768
Offset: 1

Author

Paul Richards, Aug 28 2006

Keywords

Comments

For some algorithms for finding A034699(n), the numbers in this sequence represent a worst-case scenario of execution time.

Examples

			437 = 19*23 and none of the intervening integers (20,21,22) are prime powers.
		

Crossrefs

Programs

  • Mathematica
    t = Join[{1}, Select[Range[2, 131], Mod[ #, # - EulerPhi[ # ]] == 0 &]]; Most@t*Rest@t (* Robert G. Wilson v, Sep 02 2006 *)
  • PARI
    lista(nn) = v = concat(1, select(x->isprimepower(x), vector(nn, n, n))); for (n=1, #v-1, print1(v[n]*v[n+1], ", ")); \\ Michel Marcus, Mar 20 2015

Formula

a(n) = A000961(n)*A000961(n+1).

Extensions

More terms from Robert G. Wilson v, Sep 02 2006