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.

A340510 A permutation of the positive integers with a divisibility property (see Comments for precise definition).

Original entry on oeis.org

1, 3, 5, 2, 8, 10, 4, 13, 15, 6, 18, 7, 21, 23, 9, 26, 28, 11, 31, 12, 34, 36, 14, 39, 41, 16, 44, 17, 47, 49, 19, 52, 20, 55, 57, 22, 60, 62, 24, 65, 25, 68, 70, 27, 73, 75, 29, 78, 30, 81, 83, 32, 86, 33, 89, 91, 35, 94, 96, 37, 99, 38, 102, 104, 40, 107, 109
Offset: 1

Views

Author

N. J. A. Sloane, Jan 28 2021

Keywords

Comments

a(1)=1; thereafter a(n) is the least positive number not yet in the sequence such that Sum_{i=1..n} a(i) == 1 mod n+1.

Crossrefs

Programs

  • Maple
    A000045_inv := proc(n)
        local k ;
        for k from 0 do
            if combinat[fibonacci](k) = n then
                return k;
            elif combinat[fibonacci](k) > n then
                return -1;
            end if;
        end do:
    end proc:
    A000071_inv := proc(n)
        local k ;
        for k from 0 do
            if combinat[fibonacci](k)-1 = n then
                return k;
            elif combinat[fibonacci](k)-1 > n then
                return -1;
            end if;
        end do:
    end proc:
    A000201_inv := proc(n)
        local k,w ;
        for k from 1 do
            w := floor(k*(1+sqrt(5))/2) ;
            if w = n then
                return k;
            elif w > n then
                return -1;
            end if;
        end do:
    end proc:
    A001950_inv := proc(n)
        local k,w ;
        for k from 1 do
            w := floor(k*(3+sqrt(5))/2) ;
            if w = n then
                return k;
            elif w > n then
                return -1;
            end if;
        end do:
    end proc:
    A340510 := proc(n)
        local k ;
        if n = 1 then
            1;
        else
            k := A000045_inv(n) ;
            if k > 2 then
                return combinat[fibonacci](k+1) ;
            end if;
            k := A000071_inv(n) ;
            if k > 4 then
                return combinat[fibonacci](k-1)-1 ;
            end if;
            k := A000201_inv(n) ;
            if k > 0 then
                return floor(k*(3+sqrt(5))/2) ;
            end if;
            k := A001950_inv(n) ;
            return floor(k*(1+sqrt(5))/2) ;
        end if;
    end proc:
    seq(A340510(n),n=1..50) ; # R. J. Mathar, Jan 30 2024
  • Mathematica
    a[n_] := a[n] = Switch[n, 1, 1, 2, 3, 3, 5, 4, 2, _, Module[{aa, ss, dd, an}, aa = Array[a, n-1]; ss = Sort[aa]; dd = Differences[ss]; For[an = Select[Transpose[{Rest[ss], dd}], #[[2]] == 1 &][[-1, 1]]+1, True, an++, If[FreeQ[aa = Array[a, n-1], an], If[Mod[Total[aa] + an, n+1] == 1, Return[an]]]]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 31 2021 *)

Formula

Theorem 1 of Avdispahić and Zejnulahi gives an explicit formula involving Fibonacci numbers.

Extensions

More terms from Alois P. Heinz, Jan 28 2021