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: James Carruthers

James Carruthers's wiki page.

James Carruthers has authored 3 sequences.

A367857 a(n) is the smallest base b such that (b+1)^n in base b is a palindrome.

Original entry on oeis.org

2, 2, 2, 7, 11, 21, 36, 71, 127, 253, 463, 925, 1717, 3433, 6436, 12871, 24311, 48621, 92379, 184757, 352717, 705433, 1352079, 2704157, 5200301, 10400601, 20058301, 40116601, 77558761, 155117521, 300540196, 601080391, 1166803111
Offset: 1

Author

James Carruthers, Dec 03 2023

Keywords

Comments

Empirically the same as A001405(n)+1 apart from a(2) where 11^10=1001 in base 2 (3^2=9 in base 10) and a(3) where 11^11=11011 in base 2 (3^3=27 in base 10).

Examples

			For n=5 the minimum base required is 11, giving 11^5=15aa51 (12^5=248832 in base 10).
		

Crossrefs

Cf. A001405.

Programs

  • Mathematica
    a[n_] := Module[{b = 2, d},  While[(d = IntegerDigits[(b + 1)^n, b]) != Reverse[d],   b++  ];  b] ;
    Table[a[n],{n,33}] (* James C. McMahon, Dec 13 2023 after PARI *)
  • PARI
    a(n) = my(b=2,d); while ((d=digits((b+1)^n, b)) != Vecrev(d), b++); b; \\ Michel Marcus, Dec 05 2023
  • Python
    from itertools import count
    from sympy.ntheory.factor_ import digits
    def ispal(d): return d == d[::-1]
    def a(n): return next(b for b in count(2) if ispal(digits((b+1)**n, b)[1:]))
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Dec 04 2023
    

Formula

Conjecture: a(n) = binomial(n, floor(n/2))+1 for n>3.

Extensions

a(8)-a(33) from Michael S. Branicky, Dec 04 2023

A327788 a(n) is the smallest nonnegative integer m such that the integer part of tan(m) is equal to n.

Original entry on oeis.org

0, 1, 20, 17, 105, 237, 303, 14, 58, 80, 124, 146, 11151, 168, 46318, 190, 46695, 212, 23997, 58432, 234, 13014, 38574, 61649, 82949, 256, 16586, 33271, 48891, 63091, 76581, 89361, 278, 8088, 18738, 28678, 37908, 46783, 54948, 63113, 70568, 77668, 84768, 91158, 97193, 300, 4915, 10240, 15565, 20535, 25150
Offset: 0

Author

James Carruthers, Sep 25 2019

Keywords

Examples

			tan(0) = 0, so a(0) = 0.
tan(1) = 1.557407724654902230506974807... so a(1) = 1.
For m = 2, 3, 4, ... , 13, 15, 16, 18, 19, tan(m) < 2, tan (14) = 7.24460661609480..., tan(17) = 3.493915645474... and tan(20) = 2.2371609442247422652871732477... so a(2) = 20.
		

Crossrefs

Cf. A000503 (floor(tan(n))).

Programs

  • Magma
    a:=[]; for n in [0..50] do m:=0; while Floor(Tan(m)) ne n do m:=m+1; end while; Append(~a,m); end for; a; // Marius A. Burtea, Oct 05 2019
    
  • Mathematica
    Array[Block[{m = 0}, While[IntegerPart@ Tan@ m != #, m++]; m] &, 40, 0] (* Michael De Vlieger, Oct 05 2019 *)
  • PARI
    a(n) = my(k=0); while (floor(tan(k)) != n, k++); k; \\ Michel Marcus, Oct 05 2019
  • Python
    import numpy as np
    import math as m
    n = 1
    i = 0
    inp = np.zeros(1)
    out = inp
    while n < 10001:
        k=m.trunc(m.tan(i))
        if k==n:
            inp = np.append(inp,int(n))
            out = np.append(out,int(i))
            print(n,i)
            n += 1
            i = 0
            continue
        else:
            i+=1
    

A309320 a(n) is the smallest positive integer m such that the digits of n in base 10 are also the first digits of sin(m) in base 10 after the decimal point.

Original entry on oeis.org

0, 3, 6, 53, 9, 10, 7, 4, 1, 2, 91, 69, 47, 25, 3, 41, 63, 85, 107, 129, 151, 160, 138, 116, 94, 72, 50, 6, 16, 38, 60, 82, 104, 148, 170, 163, 141, 97, 75, 53, 31, 9, 13, 57, 79, 101, 145, 167, 166, 122, 100, 78, 34, 12, 10, 32, 76, 98, 120, 164, 147, 125, 81
Offset: 0

Author

James Carruthers, Sep 21 2019

Keywords

Examples

			a(1) = 3 because we have sin(1.) = 0.8414709848..., sin(2.) = 0.9092974268..., sin(3.) = 0.1411200081.. - _N. J. A. Sloane_, Sep 28 2019
		

Programs

  • Mathematica
    a[0] =0; a[n_] := Module[{m = 1}, While[(d = IntegerDigits[n]) != RealDigits[ Sin[m], 10, Length[d], -1][[1]], m++]; m]; Array[a, 100, 0] (* Amiram Eldar, Sep 28 2019 *)
  • Python
    import numpy as np
    import math as m
    n = 1
    i = 0
    inp = np.zeros(1)
    out = inp
    while n < 10001:
        k=m.fabs( m.trunc( m.sin(i) * m.pow( 10,m.floor( m.log10(n)+1 ) ) ) )
        if k==n:
            inp = np.append(inp,int(n))
            out = np.append(out,int(i))
            print(n,i)
            n += 1
            i = 0
            continue
        else:
            i+=1