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.

Previous Showing 21-30 of 30 results.

A340407 a(n) gives the number of side-branches that will be passed, if A342369 is used to trace the Collatz tree backward starting at 6*n-2 with n > 0.

Original entry on oeis.org

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

Views

Author

Thomas Scheuerle, Mar 24 2021

Keywords

Comments

Recursion into A342369 means tracing the Collatz tree backward, starting at k = A342369(6*n-2), then k = A342369(k) until k is divisible by 3. At each A342369(k) = 3*m - 1, a new side-branch is connected which would start at 6*m-2. If A342369(k) reached a value divisible by three no further side-branches will be found.
This sequence is a rearrangement of A087088 such that all values at positions divisible by 3 are unchanged.

Examples

			n = 2:
6*n-2 = 10.
A342369(10) = 20. -> 7*3 - 1 -> A side-branch is connected.
A342369(20) = 13.
A342369(13) = 26. -> 9*3 - 1 -> A side-branch is connected.
A342369(26) = 17. -> 6*3 - 1 -> A side-branch is connected.
A342369(17) = 11. -> 4*3 - 1 -> A side-branch is connected.
A342369(11) = 7.
A342369(7) = 14. -> 5*3 - 1 -> A side-branch is connected.
A342369(14) = 9. -> divisible by 3 we stop here.
-> We found 5 connected side-branches, a(2) = 5.
		

Crossrefs

Programs

  • MATLAB
    function a = A340407( max_n )
        for n = 1:max_n
            c = 0;
            s = 6*n -2;
            while mod(s,3) ~= 0
                s = A342369( s );
                if mod(s,3) == 2
                    c = c+1;
                end
            end
            a(n) = c;
        end
    end
    function b = A342369( n )
        if mod(n,3) == 2
            b = (2*n - 1)/3;
        else
            b = 2*n;
        end
    end

Formula

a(n) > 0.
a(3*n) = 1.
a(9*n - b) = 2, b = {1, 8} row 2 of A342261. ( a(A056020(n)) = 2 ).
a(27*n - b) = 3, b = {2, 4, 5, 16} row 3 of A342261.
a(81*n - b) = 4, b = {13, 14, 22, 34, 38, 52, 74, 77} row 4 of A342261.
a(3^k*n - b) = k, b = row k of A342261.
( Sum_{k=1..j} a(k) )/j lim_{j->infinity} = 3 = Sum_{k=1..infinity} k*2^(k-1)/3^k.

A135027 Numbers k such that the sum of the digits of k^2 is 10. Multiples of 10 are omitted.

Original entry on oeis.org

8, 19, 35, 46, 55, 71, 145, 152, 179, 251, 332, 361, 449, 451, 548, 649, 4499, 20249, 20251, 24499, 100549, 114499, 316261
Offset: 1

Views

Author

Zak Seidov, Feb 10 2008

Keywords

Comments

A subsequence of A056020. - R. J. Mathar, Feb 10 2008
Next term > 10000000. - R. J. Mathar, Oct 20 2009
If it exists, a(24) > 10^10. - Hugo Pfoertner, May 17 2021
If it exists, a(24) > 10^29. - Michael S. Branicky, May 30 2021

Examples

			Corresponding squares are 64, 361, 1225, 2116, 3025, 5041, 21025, 23104, 32041, 63001, 110224, 130321, 201601, 203401, 300304, 421201, 20241001, 410022001, 410103001, 600201001, 10110101401, 13110021001, 100021020121.
8^2 = 64 and 6+4 = 10. 316261^2 = 100021020121 and 1+0+0+0+2+1+0+2+0+1+2+1 = 10. - _Zak Seidov_, Aug 26 2009
		

Crossrefs

Programs

  • Mathematica
    s={};Do[If[Mod[n,10]>0&&10==Total[IntegerDigits[n^2]],AppendTo[s,n]], {n,10^8}];s (* Zak Seidov, Aug 26 2009 *)
  • PARI
    is(n) = sumdigits(n^2)==10 && n%10 > 0 \\ Felix Fröhlich, May 17 2021
  • Python
    def A007953(n):
        a=0
        sh=n
        while sh > 0:
            a += sh % 10
            sh //= 10
        return a
    def isA135027(n):
        if n % 10 == 0:
            return False
        else:
            return A007953(n**2) == 10
    for n in range(70000):
        if isA135027(n):
            print(n)
    # R. J. Mathar, Oct 20 2009
    
  • Python
    # See linked program to go to large numbers
    def ok(n): return n%10 != 0 and sum(map(int, str(n*n))) == 10
    print(list(filter(ok, range(316262)))) # Michael S. Branicky, May 30 2021
    

A056528 Sum of digits of square of sum of digits of square.

Original entry on oeis.org

1, 7, 9, 13, 13, 9, 16, 1, 9, 1, 7, 9, 13, 13, 9, 16, 10, 9, 1, 7, 9, 13, 13, 9, 16, 10, 9, 10, 16, 9, 13, 13, 9, 16, 1, 9, 10, 16, 9, 13, 13, 9, 16, 10, 9, 1, 16, 9, 13, 13, 9, 16, 10, 9, 1, 16, 9, 13, 13, 9, 16, 10, 18, 10, 16, 9, 13, 13, 9, 16, 1, 9, 10, 16, 9, 13, 13, 9, 16, 1, 9
Offset: 1

Views

Author

Henry Bottomley, Jun 19 2000

Keywords

Examples

			a(2)=7 because sum of digits of square of 2 is 4 and sum of digits of square of 4 is 1+6=7
		

Crossrefs

Cf. A004159 for sum of digits of square, A056020 where iteration settles to 1, A056020 where iteration settles to 9, A056527 where iteration settles to 13 and 16. See also A056529.

Programs

  • Mathematica
    Array[Total[IntegerDigits[(Total[IntegerDigits[#^2]])^2]]&,90] (* Harvey P. Dale, Jan 17 2012 *)
    Table[Nest[Total[IntegerDigits[#^2]]&,n,2],{n,90}] (* Harvey P. Dale, Mar 07 2018 *)

Formula

a(n)=A004159(A004159(n))

A056529 Number of iterations of sum of digits of square to reach 1, 9, 13 or 16.

Original entry on oeis.org

0, 3, 1, 2, 2, 1, 1, 2, 0, 1, 3, 1, 0, 1, 1, 0, 3, 1, 2, 3, 1, 1, 1, 2, 1, 3, 2, 3, 1, 1, 1, 2, 2, 1, 2, 2, 3, 1, 1, 2, 1, 2, 2, 3, 1, 2, 1, 1, 2, 2, 1, 1, 3, 2, 2, 1, 2, 1, 1, 1, 1, 3, 3, 3, 1, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, 1, 2, 3, 2, 3, 1, 3, 2, 3, 2, 1, 2, 2, 3, 2, 1, 3, 1, 1, 1, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 19 2000

Keywords

Examples

			a(2)=3 because successive iterations give 2 -> 4 -> 7 -> 13 -> 16 -> 13 etc.
		

Crossrefs

Cf. A004159 for sum of digits of square, A056528 for two iterations, A056020 where iteration settles to 1, A056020 where iteration settles to 9, A056527 where iteration settles to 13 and 16.

A326614 Smallest Euler-Jacobi pseudoprime to base n.

Original entry on oeis.org

9, 561, 121, 341, 781, 217, 25, 9, 91, 9, 133, 91, 85, 15, 1687, 15, 9, 25, 9, 21, 221, 21, 169, 25, 217, 9, 121, 9, 15, 49, 15, 25, 545, 33, 9, 35, 9, 39, 133, 39, 21, 451, 21, 9, 481, 9, 65, 49, 25, 49, 25, 51, 9, 55, 9, 55, 25, 57, 15, 481, 15, 9, 529, 9, 33, 65, 33, 25, 35, 69, 9
Offset: 1

Views

Author

Richard N. Smith, Jul 14 2019

Keywords

Comments

a(n) = 9 for n == 1 or 8 mod 9 (see A056020).

Crossrefs

Cf. A047713, A048950, A090086 (least Fermat pseudoprime to base n), A298756 (least strong pseudoprime to base n).

Programs

  • Mathematica
    ejpspQ[n_,b_] := CoprimeQ[n,b] && CompositeQ[n] && Mod[b^((n - 1)/2) - JacobiSymbol[b, n], n] == 0; leastEJpsp[b_] := Module[{k=9}, While[!ejpspQ[k, b], k+=2]; k]; Array[leastEJpsp, 100] (* Amiram Eldar, Jul 15 2019 *)
  • PARI
    isok(k, n) = ((k%2==1) && (gcd(k, n)==1) && Mod(n, k)^((k-1)/2)==kronecker(n, k) && !isprime(k));
    a(n) = my(k=2); while (! isok(k, n), k++); k; \\ Michel Marcus, Jul 15 2019

A061099 Squares with digital root 1.

Original entry on oeis.org

1, 64, 100, 289, 361, 676, 784, 1225, 1369, 1936, 2116, 2809, 3025, 3844, 4096, 5041, 5329, 6400, 6724, 7921, 8281, 9604, 10000, 11449, 11881, 13456, 13924, 15625, 16129, 17956, 18496, 20449, 21025, 23104, 23716, 25921, 26569, 28900, 29584
Offset: 1

Views

Author

Amarnath Murthy, Apr 19 2001

Keywords

Examples

			289 = 17^2, 2+8+9 = 19, 1+9 = 1, 1369 = 37^2, 1+3+6+9 = 19, 1+9 = 1.
		

Crossrefs

Squares of A056020.
Cf. A056991.

Programs

Formula

From Colin Barker, Apr 21 2012: (Start)
a(n) = (9*n+2)^2/4 for n even; a(n)=(9*n+7)^2/4 for n odd.
G.f.: x*(1+63*x+34*x^2+63*x^3+x^4)/((1-x)^3*(1+x)^2). (End)
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5). - Wesley Ivan Hurt, Apr 21 2021

Extensions

More terms from Harry J. Smith, Jul 17 2009

A235399 Numbers which are the digital sum of the cube of some prime.

Original entry on oeis.org

8, 9, 10, 17, 19, 26, 28, 35, 37, 44, 46, 53, 55, 62, 64, 71, 73, 80, 82, 89, 91, 98, 100, 107, 109, 116, 118, 125, 127, 134, 136, 143, 145, 152, 154, 161, 163, 170, 172, 179, 181, 188, 190, 197, 199, 206, 208, 215, 217, 224, 226, 233, 235, 242, 244, 251, 253
Offset: 1

Views

Author

Keywords

Comments

A235398 sorted and duplicates removed.

Crossrefs

Programs

  • Mathematica
    Total[IntegerDigits[#]] & /@ (Prime[Range[5000000]]^3) // Union (* The program generates the first 39 terms of the sequence. To generate more, increase the Range constant. *) (* Harvey P. Dale, Sep 19 2021 *)
  • PARI
    list(maxx)={v=List();n=2; while(n<=maxx,q=n^3;summ=sumdigits(q);
    if(setsearch(v,summ)<1,listput(v,summ));n=nextprime(n+1));vecsort(v,,8) ;} \\ Bill McEachen, Jan 29 2014

Formula

Conjecture: for n > 4, a(n) = a(n-2) + 9 = A056020(n).
Conjecture: a(n) = (1/4)*(-1)^n*(9*(-1)^n*(2*n-1) + 5), n >= 3. - Bill McEachen, Feb 13 2021

Extensions

a(37)-a(57) from Lars Blomberg, Feb 10 2016

A266957 Numbers m such that 9*m+10 is a square.

Original entry on oeis.org

-1, 6, 10, 31, 39, 74, 86, 135, 151, 214, 234, 311, 335, 426, 454, 559, 591, 710, 746, 879, 919, 1066, 1110, 1271, 1319, 1494, 1546, 1735, 1791, 1994, 2054, 2271, 2335, 2566, 2634, 2879, 2951, 3210, 3286, 3559, 3639, 3926, 4010, 4311, 4399, 4714, 4806, 5135, 5231, 5574
Offset: 1

Views

Author

Bruno Berselli, Jan 07 2016

Keywords

Comments

Equivalently, numbers of the form h*(9*h+2)-1, where h = 0, -1, 1, -2, 2, -3, 3, -4, 4, ...
Also, integer values of k*(k+2)/9 minus 1.

Crossrefs

Cf. A132355.
Cf. similar sequences listed in A266956.
Cf. A056020: square roots of 9*a(n)+10.

Programs

  • Magma
    [n: n in [-1..6000] | IsSquare(9*n+10)];
    
  • Magma
    [(18*(n-1)*n+5*(2*n-1)*(-1)^n-3)/8: n in [1..50]];
  • Mathematica
    Select[Range[-1, 6000], IntegerQ[Sqrt[9 # + 10]] &]
    Table[(18 (n - 1) n + 5 (2 n - 1) (-1)^n - 3)/8, {n, 1, 50}]
  • PARI
    for(n=-1, 6000, if(issquare(9*n+10), print1(n, ", ")))
    
  • PARI
    vector(50, n, n; (18*(n-1)*n+5*(2*n-1)*(-1)^n-3)/8)
    
  • Python
    from gmpy2 import is_square
    [n for n in range(-1,6000) if is_square(9*n+10)]
    
  • Python
    [(18*(n-1)*n+5*(2*n-1)*(-1)**n-3)/8 for n in range(1, 60)]
    
  • Sage
    [n for n in (-1..6000) if is_square(9*n+10)]
    
  • Sage
    [(18*(n-1)*n+5*(2*n-1)*(-1)^n-3)/8 for n in (1..50)]
    

Formula

G.f.: x*(-1 + 7*x + 6*x^2 + 7*x^3 - x^4)/((1 + x)^2*(1 - x)^3).
a(n) = a(-n+1) = (18*(n-1)*n + 5*(2*n-1)*(-1)^n - 3)/8.
a(n) = A132355(n) + 1.

A319293 Numbers of the form 27^i*(9*j +- 1).

Original entry on oeis.org

1, 8, 10, 17, 19, 26, 27, 28, 35, 37, 44, 46, 53, 55, 62, 64, 71, 73, 80, 82, 89, 91, 98, 100, 107, 109, 116, 118, 125, 127, 134, 136, 143, 145, 152, 154, 161, 163, 170, 172, 179, 181, 188, 190, 197, 199, 206, 208, 215, 216, 217, 224, 226, 233, 235, 242, 244
Offset: 1

Views

Author

Jianing Song, Sep 16 2018

Keywords

Comments

{+-a(n)} gives all nonzero cubes modulo all powers of 3, that is, cubes over 3-adic integers. So this sequence is closed under multiplication.

Crossrefs

A056020 is a proper subsequence.
Perfect powers over 3-adic integers:
Squares: positive: A055047; negative: A055048 (negated);
Cubes: this sequence.

Programs

  • PARI
    isA319293(n)= n\27^valuation(n, 27)%9==1||n\27^valuation(n, 27)%9==8
    
  • Python
    from sympy import integer_log
    def A319293(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((m:=x//27**i)-1)//9+(m-8)//9+2 for i in range(integer_log(x,27)[0]+1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 13*n/3 + O(log(n)).

A135029 Numbers k such that k and k^2 both have digit sum 10. Multiples of 10 are omitted.

Original entry on oeis.org

19, 46, 55, 145, 361, 451, 20251
Offset: 1

Views

Author

Zak Seidov, Feb 10 2008

Keywords

Comments

A subsequence of A056020. - R. J. Mathar, Feb 10 2008
No further terms < 3*10^12 of the form 9*k+1, k=1,2,3,... - Lars Blomberg, Jun 28 2011
No further terms < 10^30. - Charles R Greathouse IV, Jun 29 2011

Examples

			Corresponding squares are 361, 2116, 3025, 21025, 130321, 203401, 410103001.
		

Crossrefs

Cf. A056020.

Programs

  • PARI
    dsum(n)=my(s=n%10);while(n\=10,s+=n%10);s
    do(L)=my(E,F,G,H,t);for(a=1,L-1, for(b=0,a, for(c=0,b, for(d=0,c, for(e=0,d, E=10^a+10^b+10^c+10^d+10^e; for(f=0,e,F=E+10^f; for(g=0,f, G=F+10^g; for(h=0,g, H=G+10^h; for(i=0,h, t=H+10^i+1; if(dsum(t^2)==10, print1(t", ")))))))))));
    do(30) \\ Charles R Greathouse IV, Jun 29 2011
Previous Showing 21-30 of 30 results.