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-5 of 5 results.

A160256 a(1)=1, a(2)=2. For n >=3, a(n) = the smallest positive integer not occurring earlier in the sequence such that a(n)*a(n-1)/a(n-2) is an integer.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 16, 18, 24, 12, 10, 30, 5, 36, 15, 48, 20, 60, 7, 120, 14, 180, 21, 240, 28, 300, 35, 360, 42, 420, 11, 840, 22, 1260, 33, 1680, 44, 2100, 55, 2520, 66, 2940, 77, 3360, 88, 3780, 110, 378, 165, 126, 220, 63, 440, 189, 880, 567, 1760
Offset: 1

Views

Author

Leroy Quet, May 06 2009

Keywords

Comments

Is this sequence a permutation of the positive integers?
a(n+2)*a(n+1)/a(n) = A160257(n).
From Alois P. Heinz, May 07 2009: (Start)
After computing about 10^7 elements of A160256 we have
a(10000000) = 2099597439752627193722111679586865799879114417
a(10000001) = 992131130100042530286371815859160
Largest element so far:
a(8968546) = 24941014474345046106920043019655502800839523254002490663461\
524119982890708516899294655028121578883343551450916846444559467340663409\
549447588184641816
Still missing:
19, 23, 27, 29, 31, 32, 37, 38, 41, 43, 45, 46, 47, 53, 54, 57, 58, 59,
61, 62, 64, 67, 69, 71, 72, 73, 74, 76, 79, 81, 82, 83, 86, 87, 89, 90,
92, 93, 94, 95, 96, 97, 101, 103, 105, 106, 107, 108, 109, 111, 112, 113,
114, 115, 116, 118, 122, 123, 124, 125, 127, 128, 129, 131, 133, 134, ...
Primes in sequence so far:
2, 3, 5, 7, 11, 13, 17
The sequence consists of two subsequences, even (=red) and odd (=blue), see plot. (End)
a(n) is the least multiple of a(n-2)/gcd(a(n-1),a(n-2)) that has not previously occurred. - Thomas Ordowski, Jul 15 2015

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a160256 n = a160256_list !! (n-1)
    a160256_list = 1 : 2 : f 1 2 [3..] where
       f u v ws = g ws where
         g (x:xs) | mod (x * v) u == 0 = x : f v x (delete x ws)
                  | otherwise          = g xs
    -- Reinhard Zumkeller, Jan 31 2014
    
  • Maple
    b:= proc(n) option remember; false end:
    a:= proc(n) option remember; local k, m;
          if n<3 then b(n):=true; n
        else m:= denom(a(n-1)/a(n-2));
             for k from m by m while b(k) do od;
             b(k):= true; k
          fi
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, May 16 2009
    # alternative
    A160256 := proc(n)
        local r,m,a,fnd,i ;
        option remember;
        if n <=2 then
            n;
        else
            r := procname(n-2)/igcd(procname(n-1),procname(n-2)) ;
            for m from 1 do
                a := m*r ;
                fnd := false;
                for i from 1 to n-1 do
                    if procname(i) = a then
                        fnd := true;
                        break;
                    end if;
                end do:
                if not fnd then
                    return a ;
                end if;
            end do:
        end if;
    end proc:
    seq(A160256(n),n=1..40) ; # R. J. Mathar, Jul 30 2024
  • Mathematica
    f[s_List] := Block[{k = 1, m = Denominator[ s[[ -1]]/s[[ -2]]]}, While[ MemberQ[s, k*m] || Mod[k*m*s[[ -1]], s[[ -2]]] != 0, k++ ]; Append[s, k*m]]; Nest[f, {1, 2}, 56] (* Robert G. Wilson v, May 17 2009 *)
  • PARI
    LQ(nMax)={my(a1=1,a2=1,L=1/*least unseen number*/,S=[]/*used numbers above L*/);
    while(1, /*cleanup*/ while( setsearch(S,L),S=setminus(S,Set(L));L++);
    /*search*/ for(a=L,nMax, a*a2%a1 & next; setsearch(S,a) & next;
    print1(a","); a1=a2; S=setunion(S,Set(a2=a)); next(2));return(L))} \\ M. F. Hasler, May 06 2009
    
  • PARI
    L=10^4;a=vector(L);b=[1,2];a[1]=1;a[2]=2;sb=2;P2=2;pending=[];sp=0;for(n=3,L,if(issquare(n),b=vecsort(concat(b,pending));sb=n-1;while(sb>=2*P2,P2*=2);sp=0;pending=[]);c=a[n-2]/gcd(a[n-2],a[n-1]);u=0;while(1,u+=c;found=0;s=0;pow2=P2;while(pow2,s2=s+pow2;if((s2<=sb)&&(b[s2]<=u),s=s2);pow2\=2);if((s>0)&&(b[s]==u),found=1,for(i=1,sp,if(pending[i]==u,found=1;break)));if(found==0,break));a[n]=u;pending=concat(pending,u);sp++);a \\ Robert Gerbicz, May 16 2009
    
  • Python
    from math import gcd
    A160256_list, l1, l2, m, b = [1, 2], 2, 1, 1, {1, 2}
    for _ in range(10**3):
        i = m
        while True:
            if not i in b:
                A160256_list.append(i)
                l1, l2, m = i, l1, l1//gcd(l1, i)
                b.add(i)
                break
            i += m # Chai Wah Wu, Dec 09 2014

Extensions

More terms from M. F. Hasler, May 06 2009
Edited by N. J. A. Sloane, May 16 2009

A151413 Index at which n occurs in A160256, or -1 if n never occurs.

Original entry on oeis.org

1, 2, 3, 4, 14, 5, 20, 6, 7, 12, 32, 11, 301, 22, 16, 8, 1065, 9
Offset: 1

Views

Author

N. J. A. Sloane, May 16 2009

Keywords

Comments

After a(19) which exceeds 10^7 but is still unknown, the sequence continues 18,24,34,a(23)=?,10,215,303,... - M. F. Hasler, May 16 2009

Crossrefs

Programs

  • Python
    from sympy import gcd
    def A151413(n):
        if n <= 2:
            return n
        else:
            l1, l2, m, b = 2, 1, 1, {1, 2}
            for j in range(3, 10**9):
                i = m
                while True:
                    if not i in b:
                        if i == n:
                            return j
                        l1, l2, m = i, l1, l1//gcd(l1, i)
                        b.add(i)
                        break
                    i += m
            return "search limit reached." # Chai Wah Wu, Dec 09 2014

Formula

A160218(n) = a(A000040(n)), conjectured. - M. F. Hasler, May 16 2009

Extensions

a(13)-a(18) from Robert Gerbicz and M. F. Hasler, May 16 2009

A357171 a(n) is the number of divisors of n whose digits are in strictly increasing order (A009993).

Original entry on oeis.org

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

Views

Author

Bernard Schott, Sep 16 2022

Keywords

Comments

As A009993 is finite with 512 terms, a(n) is bounded with a(n) <= 511 and not 512, since A009993(1) = 0.

Examples

			22 has 4 divisors {1, 2, 11, 22} of which two have decimal digits that are not in strictly increasing order: {11, 22}, hence a(22) = 4-2 = 2.
52 has divisors {1, 2, 4, 13, 26, 52} and a(52) = 5 of them have decimal digits that are in strictly increasing order (all except 52 itself).
		

Crossrefs

Similar: A087990 (palindromic), A355302 (undulating), A355593 (alternating).

Programs

  • Maple
    f:= proc(n) local d,L,i,t;
      t:= 0;
      for d in numtheory:-divisors(n) do
        L:= convert(d,base,10);
        if `and`(seq(L[i]>L[i+1],i=1..nops(L)-1)) then t:= t+1 fi
      od;
      t
    end proc:
    map(f, [$1..100]); # Robert Israel, Sep 16 2022
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Less @@ IntegerDigits[#] &]; Array[a, 100] (* Amiram Eldar, Sep 16 2022 *)
  • PARI
    isok(d) = Set(d=digits(d)) == d; \\ A009993
    a(n) = sumdiv(n, d, isok(d)); \\ Michel Marcus, Sep 16 2022
    
  • Python
    from sympy import divisors
    def c(n): s = str(n); return s == "".join(sorted(set(s)))
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Sep 16 2022

Formula

G.f.: Sum_{n in A009993} x^n/(1-x^n). - Robert Israel, Sep 16 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n=2..512} 1/A009993(n) = 4.47614714667538759358... (this is a rational number whose numerator and denominator have 1037 and 1036 digits, respectively). - Amiram Eldar, Jan 06 2024

A357172 a(n) is the smallest integer that has exactly n divisors whose decimal digits are in strictly increasing order.

Original entry on oeis.org

1, 2, 4, 6, 16, 12, 54, 24, 36, 48, 72, 180, 144, 360, 336, 468, 504, 936, 1008, 1512, 2520, 3024, 5040, 6552, 7560, 22680, 13104, 19656, 49140, 105840, 39312, 78624, 98280, 248976, 334152, 196560, 393120, 668304, 1244880, 1670760, 1867320, 4520880, 3341520, 3734640
Offset: 1

Views

Author

Bernard Schott, Sep 16 2022

Keywords

Comments

This sequence is finite since A009993 is finite with 511 nonzero terms, hence the last term is a(511) = lcm of the 511 nonzero terms of A009993.
a(511) = 8222356410...6120992000 and has 1036 digits. - Michael S. Branicky, Sep 16 2022

Examples

			For n=7, the divisors of 54 are {1, 2, 3, 6, 9, 18, 27, 54} of which 7 have their digits in strictly increasing order (all except 54). No integer < 54 has 7 such divisors, so a(7) = 54.
		

Crossrefs

Similar: A087997 (palindromic), A355303 (undulating), A355594 (alternating).

Programs

  • Mathematica
    s[n_] := DivisorSum[n, 1 &, Less @@ IntegerDigits[#] &]; seq[len_, nmax_] := Module[{v = Table[0, {len}], n = 1, c = 0, i}, While[c < len && n < nmax, i = s[n]; If[i <= len && v[[i]] == 0, v[[i]] = n; c++]; n++]; v]; seq[25, 10^4] (* Amiram Eldar, Sep 16 2022 *)
  • PARI
    isok(d) = Set(d=digits(d)) == d; \\ A009993
    f(n) = sumdiv(n, d, isok(d)); \\ A357171
    a(n) = my(k=1); while (f(k) !=n, k++); k; \\ Michel Marcus, Sep 16 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): s = str(n); return s == "".join(sorted(set(s)))
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 1, dict()
        for k in count(1):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 37))) # Michael S. Branicky, Sep 16 2022

Extensions

More terms from Amiram Eldar, Sep 16 2022

A357173 Positions of records in A357171, i.e., integers whose number of divisors whose decimal digits are in strictly increasing order sets a new record.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 36, 48, 72, 144, 336, 468, 504, 936, 1008, 1512, 2520, 3024, 5040, 6552, 7560, 13104, 19656, 39312, 78624, 98280, 196560, 393120, 668304, 1244880, 1670760, 1867320, 3341520, 3734640, 7469280, 22407840, 26142480, 31744440, 52284960, 63488880
Offset: 1

Views

Author

Bernard Schott, Sep 17 2022

Keywords

Comments

As A009993 is finite, this sequence is necessarily finite.
Corresponding records are 1, 2, 3, 4, 6, 8, 9, 10, 11, ...

Examples

			a(6) = 24 is in the sequence because A357171(24) = 8 is larger than any earlier value in A357171.
		

Crossrefs

Similar sequences: A093036, A340548, A355595.

Programs

  • Mathematica
    s[n_] := DivisorSum[n, 1 &, Less @@ IntegerDigits[#] &]; seq = {}; sm = 0; Do[If[(sn = s[n]) > sm, sm = sn; AppendTo[seq, n]], {n, 1, 10^4}]; seq (* Amiram Eldar, Sep 17 2022 *)
  • PARI
    isok(d) = Set(d=digits(d)) == d; \\ A009993
    f(n) = sumdiv(n, d, isok(d)); \\ A357171
    lista(nn) = my(r=0, list = List()); for (k=1, nn, my(m=f(k)); if (m>r, listput(list, k); r = m);); Vec(list); \\ Michel Marcus, Sep 18 2022

Extensions

More terms from Amiram Eldar, Sep 17 2022
Showing 1-5 of 5 results.