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: Alex Costea

Alex Costea's wiki page.

Alex Costea has authored 4 sequences.

A307165 Numbers k such that the sequence f(0)=f(1)=k, f(x)=(a*b) mod (a+b+1), where a=f(x-1) and b=f(x-2) is a cycle.

Original entry on oeis.org

0, 1, 4, 16, 22, 340
Offset: 1

Author

Alex Costea, Mar 27 2019

Keywords

Comments

Zeros of A307087.
The next term, if it exists, is bigger than 1.5*10^7.
Abmod sequences are defined as follows: see A307087.
Abmod(x,y,0) = x;
Abmod(x,y,1) = y;
Abmod(x,y,n) = (a*b) mod (a+b+1), where a and b are the 2 previous terms: Abmod(x,y,n-2) and Abmod(x,y,n-1).
a(7) > 10^9 if it exists. - Bert Dobbelaere, Aug 18 2019

Examples

			Abmod(4,4) is [4,4,7,4,4,7,4,4,7,...].
		

Crossrefs

Cf. A307087.

Programs

  • Mathematica
    cyclePos[s_] := Module[{sp = SequencePosition[s[[1 ;; -3]], s[[-2 ;; -1]]]}, If[Length[sp] == 0, 0, sp[[1, 1]]]]; a[n_] := Module[{f, g}, g[a_, b_] := Mod[a*b, a + b + 1]; f[0] = f[1] = n; f[k_] := f[k] = g[f[k - 1], f[k - 2]]; s = {}; m = 0; While[Length[s] < 4 || cyclePos[s] == 0, AppendTo[s, f[m]]; m++];  cyclePos[s] - 1]; seq = {}; Do[If[a[j] == 0, AppendTo[seq, j]], {j, 0, 340}]; seq (* Amiram Eldar, Jul 06 2019 *)

A307087 a(n) is the number of steps it takes for the sequence f(0)=f(1)=n, f(x)=(a*b) mod (a+b+1), where a=f(x-1) and b=f(x-2), to reach a cycle.

Original entry on oeis.org

0, 0, 4, 3, 0, 6, 6, 1, 13, 3, 2, 8, 3, 3, 5, 3, 0, 23, 3, 4, 11, 3, 0, 9, 11, 5, 9, 3, 10, 13, 13, 2, 5, 3, 9, 4, 7, 6, 23, 3, 34, 23, 8, 2, 12, 3, 22, 9, 8, 7, 16, 3, 1, 19, 60, 12, 27, 3, 7, 15, 22, 4, 25, 3, 30, 12, 10, 11, 22, 3, 6, 12, 3, 8, 19, 3, 10
Offset: 0

Author

Alex Costea, Mar 23 2019

Keywords

Comments

Abmod sequences are defined as follows:
Abmod(x,y,0) = x,
Abmod(x,y,1) = y,
Abmod(x,y,k) = (a*b) mod (a+b+1), where a and b are the 2 previous terms (a = Abmod(x,y,k-1), b = Abmod(x,y,k-2)).
It seems that a(n)=3 if n=6k+3 for nonnegative integer k.
Conjecture: for every n, a(n) is finite (that is, the sequence ends up in a cycle).

Examples

			For a(8), the sequence f is 8, 8, 13, 16, 28, 43, 52, 28, 79, 52, 16, 4, 1, and then 4, 4, 7 repeated, thus a(8) is 13.
		

Programs

  • Mathematica
    cyclePos[s_] := Module[{sp = SequencePosition[s[[1 ;; -3]], s[[-2 ;; -1]]]}, If[Length[sp] == 0, 0, sp[[1, 1]]]]; a[n_] := Module[{f, g}, g[a_, b_] := Mod[a*b, a + b + 1]; f[0] = f[1] = n; f[k_] := f[k] = g[f[k - 1], f[k - 2]]; s = {}; m = 0; While[Length[s] < 4 || cyclePos[s] == 0, AppendTo[s, f[m]]; m++]; cyclePos[s] - 1]; Array[a, 100, 0] (* Amiram Eldar, Jul 06 2019 *)

A307099 Positive integers k at which k/log_2(k) is at a record closeness to an integer, without actually being an integer.

Original entry on oeis.org

3, 10, 51, 189, 227, 356, 578, 677, 996, 3389, 38997, 69096, 149462, 2208495, 3459604, 4952236, 6710605, 48098656, 81762222, 419495413
Offset: 1

Author

Alex Costea, Mar 24 2019

Keywords

Comments

The closeness of a real number x to an integer is measured as abs(x-round(x)).
k/log_2(k) can also be written as log(k,2^k). Thus, this is also where 2^k is at a record closeness to a power of k (logarithmically).
k/log_2(k) is an integer iff k is in A001146, so these integers are ignored.

Examples

			10/log_2(10) = 3.010... ~ 3, which is an integer. Or, 2^10 = 1024, which is close to 1000 = 10^3.
996/log_2(996) = 99.99998060...
		

Crossrefs

Cf. A001146.

Programs

  • Mathematica
    With[{s = {-1}~Join~Array[-Abs[Round[#] - #] &[#/Log2[#]] /. 0 -> -1 &, 10^5, 2]}, Rest@ Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* Michael De Vlieger, Mar 27 2019 *)
  • Python
    from math import floor,ceil,log
    x=2
    mindif=1
    while True:
        logn=x/log(x,2)
        dif=min(logn-floor(logn),ceil(logn)-logn)
        if dif!=0 and mindif>dif:
            mindif=dif
            print(x,end=", ")
        x+=1

A307175 Smallest power to which 1+1/n must be raised in order for an interval [k,k+1], with k an integer, to be skipped.

Original entry on oeis.org

4, 7, 9, 13, 15, 18, 22, 26, 27, 32, 33, 40, 42, 48, 51, 55, 58, 62, 66, 71, 75, 80, 85, 85, 91, 97, 103, 105, 111, 112, 120, 121, 129, 131, 139, 142, 143, 153, 156, 158, 168, 172, 175, 178, 181, 193, 197, 201, 206, 210, 215, 220, 225, 230, 235, 241, 246, 252
Offset: 2

Author

Alex Costea, Mar 27 2019

Keywords

Comments

Here the skipping of an interval means that the interval falls strictly between (1+1/n)^(a(n)-1) and (1+1/n)^a(n).
The sequence is not monotonically increasing; a(24) = a(25) and a(62) > a(63) are the first counterexamples.
Asymptotic to n * log(n), and as such also to the prime numbers (A000040).

Examples

			1.1^26 = 11.918... and 1.1^27 = 13.109...; [12,13] is skipped, and this is the first time this happens, thus a(10)=27.
		

Crossrefs

Cf. A031435.

Programs

  • Mathematica
    a[n_, m_] := Reduce[(1+1/n)^(m-1) < k < k+1 < (1+1/n)^m, k, Integers];
    a[n_] := For[m = 1, True, m++, If[a[n, m] =!= False, Return[m]]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jul 07 2019 *)
  • PARI
    a(n) = my(k=2, last=1+1/n); while(floor(new = (1+1/n)^k) - ceil(last) != 1, k++; last = new); k; \\ Michel Marcus, Mar 30 2019
    
  • Python
    from math import floor, log
    def get_a_of_n(i):
         x=1+1/i
         j=i
         while floor(log(j, x))!=floor(log(j+1, x)):
             j+=1
         return floor(log(j, x))+1
    def main():
         step=1
         i=2
         while True:
             y=get_a_of_n(i)
             print(y, end=", ")
             i+=step