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

A075076 Integers pertaining to A075075: a(n) = b(n-1)*b(n+1)/b(n) where b(n) is the n-th term of A075075.

Original entry on oeis.org

2, 3, 2, 10, 6, 4, 15, 6, 20, 12, 12, 30, 12, 28, 6, 33, 14, 7, 44, 13, 14, 34, 26, 15, 51, 18, 55, 36, 24, 55, 20, 56, 30, 30, 56, 39, 36, 68, 52, 42, 85, 40, 77, 60, 45, 77, 42, 99, 56, 56, 99, 72, 80, 54, 57, 30, 46, 38, 29, 23, 62, 58, 37, 31, 82, 74, 38, 123, 38, 86, 114, 39
Offset: 2

Views

Author

Amarnath Murthy, Sep 09 2002

Keywords

Comments

This is not a permutation of the natural numbers since a(4)=a(2), a(9)=a(6), a(12)=a(11) etc. [From Hagen von Eitzen, May 16 2009]

Crossrefs

Cf. A075075.

Programs

  • Maple
    c:= proc() false end:
    b:= proc(n) option remember; local k, m;
           if n<3 then k:=n
         else m:= denom(b(n-2) /b(n-1));
              for k from m by m while c(k) do od
           fi;
           c(k):= true; k
        end:
    a:= n-> b(n-1)*b(n+1)/b(n):
    seq(a(n), n=2..100);  # Alois P. Heinz, Jul 18 2012
  • Mathematica
    Clear[b, c]; c[] = False; b[n] := b[n] = Module[{k, m}, If[n<3, k = n, m = Denominator[b[n-2]/b[n-1]]; For[k = m, c[k], k = k+m]]; c[k] = True; k];a[n_] := b[n-1]*b[n+1]/b[n]; Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jun 10 2015, after Alois P. Heinz *)

Extensions

More terms from Sascha Kurz, Feb 03 2003

A160516 Inverse permutation to A075075.

Original entry on oeis.org

1, 2, 5, 3, 6, 4, 17, 8, 10, 7, 18, 9, 23, 20, 11, 13, 24, 15, 58, 12, 16, 19, 59, 14, 33, 22, 28, 21, 62, 26, 63, 31, 29, 25, 34, 36, 66, 57, 39, 32, 67, 35, 72, 30, 27, 60, 125, 37, 49, 44, 40, 38, 126, 47, 45, 42, 71, 61, 131, 56, 134, 64, 48, 52, 80, 46, 135, 41, 76, 43
Offset: 1

Views

Author

Hagen von Eitzen, May 16 2009

Keywords

Comments

This is a permutation of the positive integers (provided A075075 really is a permutation).

Examples

			A075075(7) = 10, therefore a(10) = 7.
A075055(17) = 7, therefore a(7) = 17.
		

Crossrefs

Cf. A185635 (fixed points).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a160516 = (+ 1) . fromJust . (`elemIndex` a075075_list)
    -- Reinhard Zumkeller, Dec 19 2012
  • Mathematica
    f[s_List] := Block[{m = Numerator[s[[ -1]]/s[[ -2]]]}, k = m; While[MemberQ[s, k], k += m]; Append[s, k]]; s = Nest[f, {1, 2}, 200]; Table[ Position[s, n, 1, 1], {n, 70}] // Flatten (* Robert G. Wilson v, May 20 2009 *)

Formula

A075075(a(n)) = n.

A185635 Fixed points of A075075.

Original entry on oeis.org

1, 2, 8, 36, 39, 49, 370, 626, 632, 1030, 13155, 32317, 61358, 86704, 2535431, 13360009
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 19 2012

Keywords

Comments

A075075(a(n)) = A160516(a(n)) = a(n);
A075075(a(n)-1) * A075075(a(n)+1) mod a(n) = 0.

Programs

  • Haskell
    a185635 n = a185635_list !! (n-1)
    a185635_list = filter (> 0) $
       zipWith (\x y -> if x == y then y else 0) [1..] a075075_list
    -- Reinhard Zumkeller, Dec 19 2012
    
  • Python
    from math import gcd
    A185635_list, l1, l2, m, b = [1, 2], 2, 1, 2, {1, 2}
    for n in range(3, 10**4):
        i = m
        while True:
            if not i in b:
                if n == i:
                    A185635_list.append(i)
                l1, l2, m = i, l1, i//gcd(l1, i)
                b.add(i)
                break
            i += m # Chai Wah Wu, Dec 09 2014

Extensions

a(15) from Chai Wah Wu, Dec 10 2014
a(16) from Chai Wah Wu, Sep 22 2019

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
Showing 1-4 of 4 results.