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 11-20 of 27 results. Next

A079806 Number of even numbers that can be formed by permuting the digits of n.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Feb 06 2003

Keywords

Comments

Leading zeros are allowed. - Robert Israel, Aug 27 2025

Examples

			a(246) = 6 (the numbers are 246,264,426,462,624,642). a(384) = 4 (the numbers are 384,348,438,834).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L, T, m, x, i,j;
       L:= convert(n,base,10);
       for i from 0 to 9 do T[i]:= numboccur(i,L) od;
       m:= nops(L);
       x:= 0;
       for i in [0,2,4,6,8] do
         if T[i] > 0 then x:= x + (m-1)!/(T[i]-1)!/mul(T[j]!,j={0$9} minus {i}); fi;
       od;
       x
    end proc;
    map(f, [$0..100]); # Robert Israel, Aug 27 2025
  • Mathematica
    Table[Count[FromDigits/@Permutations[IntegerDigits[n]],?EvenQ],{n,0,120}] (* _Harvey P. Dale, Jul 25 2020 *)

Extensions

More terms from Harvey P. Dale, Jul 25 2020

A086150 Number of permutations of decimal digits of n which yield nonprime numbers.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0, 1, 2, 1, 0, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 1, 1, 1, 1, 2, 0, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 0, 2, 0, 1, 2, 1, 1, 2, 0, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 0, 1, 1, 3, 1, 6, 3, 4, 6
Offset: 1

Views

Author

Labos Elemer, Aug 04 2003

Keywords

Comments

From Robert Israel, Aug 13 2017: (Start)
Leading zeros are allowed.
a(n) = 0 for n in A003459. (End)

Examples

			n=117, digit-permutations={117,171,711} are all composites, so a(117)=3.
		

Crossrefs

Programs

  • Maple
    f:= proc(L) option remember;
      nops(remove(isprime, map(t -> add(t[i]*10^(i-1),i=1..nops(t)), combinat:-permute(L))))
    end proc:
    seq(f(sort(convert(n,base,10))),n=1..200); # Robert Israel, Aug 13 2017
  • Mathematica
    nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] Table[Count[Table[PrimeQ[tn[Part[Permutations[ IntegerDigits[w]], j]]], {j, 1, Length[Permutations[ IntegerDigits[w]]]}], False], {w, 1, 128}]
    Table[Count[FromDigits/@Permutations[IntegerDigits[n]],?(!PrimeQ[#]&)],{n,110}] (* _Harvey P. Dale, Dec 24 2016 *)

Formula

a(n) + A039999(n) = A047726(n). - Robert Israel, Aug 13 2017

A276919 Number of solutions to x^3 + y^3 + z^3 + t^3 == 1 (mod n) for 1 <= x, y, z, t <= n.

Original entry on oeis.org

1, 8, 27, 64, 125, 216, 336, 512, 1296, 1000, 1331, 1728, 1794, 2688, 3375, 4096, 4913, 10368, 7410, 8000, 9072, 10648, 12167, 13824, 15625, 14352, 34992, 21504, 24389, 27000, 30225, 32768, 35937, 39304, 42000, 82944, 48396, 59280, 48438, 64000, 68921, 72576, 77529, 85184, 162000, 97336
Offset: 1

Views

Author

Keywords

Comments

It appears that a(n) = n^3 for n in A088232. See also A066498. - Michel Marcus, Oct 11 2016

Crossrefs

Programs

  • Mathematica
    JJJ[4, n, lam] = Sum[If[Mod[a^3 + b^3 + c^3 + d^3, n] == Mod[lam, n], 1, 0], {d, 0, n - 1}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0 , n - 1}]; Table[JJJ[4, n, 1], {n, 1, 50}]
  • PARI
    a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(t=1, n, Mod(x,n)^3 + Mod(y,n)^3 + Mod(z,n)^3 + Mod(t,n)^3 == 1)))); \\ Michel Marcus, Oct 11 2016
    
  • PARI
    qperms(v) = {my(r=1,t); v = vecsort(v); for(i=1,#v-1, if(v[i]==v[i+1], t++, r*=binomial(i,t+1);t=0));r*=binomial(#v,t+1)}
    a(n) = {my(t=0); forvec(v=vector(4,i,[1,n]), if(sum(i=1, 4, Mod(v[i], n)^3)==1, print1(v", "); t+=qperms(v)),1);t} \\ David A. Corneth, Oct 11 2016
    
  • Python
    def A276919(n):
        ndict = {}
        for i in range(n):
            i3 = pow(i,3,n)
            for j in range(i+1):
                j3 = pow(j,3,n)
                m = (i3+j3) % n
                if m in ndict:
                    if i == j:
                        ndict[m] += 1
                    else:
                        ndict[m] += 2
                else:
                    if i == j:
                        ndict[m] = 1
                    else:
                        ndict[m] = 2
        count = 0
        for i in ndict:
            j = (1-i) % n
            if j in ndict:
                count += ndict[i]*ndict[j]
        return count # Chai Wah Wu, Jun 06 2017

A276920 Number of solutions to x^3 + y^3 + z^3 + t^3 == 0 (mod n) for 1 <= x, y, z, t <= n.

Original entry on oeis.org

1, 8, 27, 72, 125, 216, 595, 704, 1539, 1000, 1331, 1944, 3133, 4760, 3375, 5632, 4913, 12312, 8911, 9000, 16065, 10648, 12167, 19008, 16125, 25064, 45927, 42840, 24389, 27000, 35371, 47104, 35937, 39304, 74375, 110808, 58645, 71288, 84591, 88000
Offset: 1

Views

Author

Keywords

Comments

a(n) = n^3 if n is in A074243. - Robert Israel, Oct 13 2016

Examples

			For n = 3, we see that all nondecreasing solutions {x, y, z, t} are in {{1, 1, 1, 3}, {1, 1, 2, 2}, {1, 2, 3, 3}, {2, 2, 2, 3}, {3, 3, 3, 3}}. The numbers in the sets can be ordered in 4, 6, 12, 4 and 1 ways respectively. Therefore, a(3) = 4 + 6 + 12 + 4 + 1 = 27. - _David A. Corneth_, Oct 11 2016
		

Crossrefs

Programs

  • Maple
    CF:= table([[false, false, true] = 12, [true, false, false] = 12, [true, false, true] = 6, [false, false, false] = 24, [true, true, true] = 1, [false, true, true] = 4, [false, true, false] = 12, [true, true, false] = 4]):
    f1:= proc(n)
      option remember;
      local count, t, x,y,z,signature;
      if isprime(n) and n mod 3 = 2 then return n^3 fi;
      count:= 0;
      for t from 1 to n do
        for x from 1 to t do
          for y from 1 to x do
            for z from 1 to y do
              if t^3 + x^3 + y^3 + z^3 mod n = 0 then
                signature:= map(evalb,[z=y,y=x,x=t]);
                count:= count + CF[signature];
              fi
      od od od od;
      count
    end proc:
    f:= proc(n) local t;
        mul(f1(t[1]^t[2]),t=ifactors(n)[2])
    end proc:
    map(f, [$1..40]); # Robert Israel, Oct 13 2016
  • Mathematica
    JJJ[4, n, lam] = Sum[If[Mod[a^3 + b^3 + c^3 + d^3, n] == Mod[lam, n], 1, 0], {d, 0, n - 1}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0 , n - 1}]; Table[JJJ[4, n, 0], {n, 1, 50}]
  • PARI
    a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(t=1, n, Mod(x,n)^3 + Mod(y,n)^3 + Mod(z,n)^3 + Mod(t,n)^3 == 0)))); \\ Michel Marcus, Oct 11 2016
    
  • PARI
    qperms(v) = {my(r=1,t); v = vecsort(v); for(i=1,#v-1, if(v[i]==v[i+1], t++, r*=binomial(i, t+1);t=0));r*=binomial(#v,t+1)}
    a(n) = {my(t=0); forvec(v=vector(4,i,[1,n]), if(sum(i=1,4,Mod(v[i],n)^3)==0, t+=qperms(v)),1);t} \\ David A. Corneth, Oct 11 2016
    
  • Python
    def A276920(n):
        ndict = {}
        for i in range(n):
            i3 = pow(i,3,n)
            for j in range(i+1):
                j3 = pow(j,3,n)
                m = (i3+j3) % n
                if m in ndict:
                    if i == j:
                        ndict[m] += 1
                    else:
                        ndict[m] += 2
                else:
                    if i == j:
                        ndict[m] = 1
                    else:
                        ndict[m] = 2
        count = 0
        for i in ndict:
            j = (-i) % n
            if j in ndict:
                count += ndict[i]*ndict[j]
        return count # Chai Wah Wu, Jun 06 2017

A319274 Osiris or Digit re-assembly numbers: numbers that are equal to the sum of permutations of subsamples of their own digits.

Original entry on oeis.org

132, 264, 396, 8991, 10545, 35964, 255530, 1559844, 9299907, 47755078, 89599104, 167264994, 283797162, 473995260, 3929996070, 6379993620, 10009998999, 11111111110, 22222222220, 33333333330, 44444444440, 55555555550, 66666666660, 77777777770, 88888888880, 99999999990
Offset: 1

Views

Author

Pieter Post, Sep 16 2018

Keywords

Comments

This sequence differs from A241754 because this sequence uses permutations only once.
Permutations are of the same length k, leading zeros are allowed.
The k's in the sequence are: 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 7, 7, 8, 7, 9, 9.

Examples

			10545 = 014 + 015 + 041 + 045 + 051 + 054 + 055 + 104 + 105 + 140 + 145 + 150 + 154 + 155 + 401 + 405 + 410 + 415 + 450 + 451 + 455 + 501 + 504 + 505 + 510 + 514 + 515 + 540 + 541 + 545 + 550 + 551 + 554.
		

Crossrefs

Programs

  • Python
    import itertools
    def getData(a, b):
        dig = (itertools.permutations(str(a), b))
        for d in dig:
            yield d
    for w in range(2, 6):
        kk=int(w*'1')
        for i in range (kk, 10**(w+3), kk):
            m=[]
            get = getData(i, w)
            while True:
                try:
                    n = next(get)
                    ee=int("".join((n)))
                    if ee not in m:
                        m.append(ee)
                except StopIteration:
                    if sum (m)==i and len(m)>1:
                        m.sort()
                        print (sum(m), len(m), m, i)
                    break

Extensions

a(12)-a(26) from Giovanni Resta, Sep 16 2018

A276354 Palindromes n > 0 such that the sum of all distinct permutations of the digits of n is also a palindrome.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 191, 202, 212, 222, 232, 242, 252, 272, 303, 313, 323, 333, 353, 404, 414, 434, 444, 515, 555, 666, 777, 787, 868, 888, 949, 999, 1001, 1111, 1221, 2002, 2112, 2222, 2992
Offset: 1

Views

Author

Altug Alkan, Sep 05 2016

Keywords

Comments

Values of A002113(n) such that A045876(A002113(n)) is in A002113 (n > 0).
If n has a zero digit then the permutations starting with 0 are included in the sum (i.e., 0010 is taken to be 10, 01 is taken to be 1, etc.).
A010785(n) is an obvious term of this sequence for all n > 0.

Examples

			101 is a term because 11 + 101 + 110 = 222 is also a palindrome.
232 is a term because 223 + 232 + 322 = 777 is also a palindrome.
2002 is a term because 22 + 202 + 220 + 2002 + 2020 + 2200 = 6666 is also a palindrome.
		

Crossrefs

Programs

A276413 Non-repdigit numbers k that divide A045876(k).

Original entry on oeis.org

370, 407, 481, 518, 592, 629, 2727, 13008, 14634, 16260, 19512, 22764, 29268, 39024, 87804, 101010, 102564, 103896, 104895, 105820, 108262, 109890, 113960, 115830, 116883, 124740, 125356, 125874, 126984, 128205, 129870, 132275, 134680, 135135, 136752
Offset: 1

Views

Author

Altug Alkan, Sep 05 2016

Keywords

Comments

A161020 is a subsequence.

Examples

			2727 is a term because 2277 + 2727 + 2772 + 7227 + 7272 + 7722 = 29997 is divisible by 2727.
		

Crossrefs

Programs

  • Maple
    filter:= proc(x) local L, D, n, M, s, j;
      L:= convert(x, base, 10);
      D:= [seq(numboccur(j, L), j=0..9)];
      if numboccur(0,D) = 9 then return false fi;
      n:= nops(L);
      M:= n!/mul(d!, d=D);
        s:= add(j*D[j+1], j=0..9);
      evalb(((10^n-1)*M/9/n*s) mod x = 0)
    end proc:
    select(filter, [$1..2*10^5]); # Robert Israel, Sep 12 2016
  • PARI
    A047726(n) = n=eval(Vec(Str(n))); (#n)!/prod(i=0, 9, sum(j=1, #n, n[j]==i)!);
    A055642(n) = #Str(n);
    A007953(n) = sumdigits(n);
    A045876(n) = ((10^A055642(n)-1)/9)*(A047726(n)*A007953(n)/A055642(n));
    isA010785(n) = {1==#Set(digits(n))}
    lista(nn) = for(n=1, nn, if(A045876(n) % n == 0 && !isA010785(n), print1(n", ")));

A276502 Least k > 0 such that A045876(n) divides A045876(n*10^k).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 6
Offset: 1

Views

Author

Altug Alkan, Sep 10 2016

Keywords

Comments

Corresponding values of A045876(n*10^a(n))/A045876(n) are 11, 11, 11, 11, 11, 11, 11, 11, 11, 101, 303, 303, 303, 303, 303, 303, 303, 303, 303, 101, 303, 303, 303, 303, 303, 303, 303, 303, 303, 101, ...
From Charlie Neder, Jul 16 2018: (Start)
From the formula for A045876(n) we make the following modifications:
- A (the mean of the digits) becomes S/D (sum of digits / # of digits)
- N (# of arrangements of digits) becomes R*Z (# of arrangements of nonzero digits * # of ways to insert the proper number of zeros)
Appending zeros to n does not change S or R, so if (S*R*Z*I/D)(n) divides (S*R*Z*I/D)(n*10^k), then (Z*I/D)(n) divides (Z*I/D)(n*10^k). However, Z, I, and D are completely determined by the number of digits of n and the number of those digits which are zero, so a(n) = a(A136400(n)). (End)

Examples

			a(10) = 2 because A045876(10) = 1+10 = 11 does not divide A045876(100) = 1+10+100 = 111 and 11 divides A045876(1000) = 1+10+100+1000 = 1111.
		

Crossrefs

Cf. A045876.

Programs

A276510 Numbers k such that the sum of all the different permutations of the digits of k (A045876(k)) is a pandigital number (a term of A171102).

Original entry on oeis.org

10234567, 10234576, 10234579, 10234597, 10234657, 10234675, 10234678, 10234687, 10234756, 10234759, 10234765, 10234768, 10234786, 10234795, 10234867, 10234876, 10234957, 10234975, 10235467, 10235476, 10235479, 10235497, 10235647, 10235674, 10235746, 10235749
Offset: 1

Views

Author

Altug Alkan, Sep 06 2016

Keywords

Examples

			10234759 is a term because A045876(10234759) = 1567999984320, which contains every digit from 0 to 9.
		

Crossrefs

Programs

A276597 Least k such that n divides A045876(k).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 10, 39, 49, 59, 69, 79, 89, 102, 199, 109, 106, 13, 599, 103, 799, 139, 108, 149, 2999, 104, 4999, 169, 12, 179, 8999, 105, 100, 289, 139, 389, 10000, 106, 79999, 13, 159, 689, 299999, 107, 100006, 1789, 179, 2789, 899999, 108, 14, 4789, 199, 5789, 5999999, 109
Offset: 1

Views

Author

Altug Alkan, Sep 08 2016

Keywords

Comments

Corresponding values of A045876(a(n))/n are 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 11, 11, 11, 11, 11, 11, 37, 111, 111, 74, 2, 111, 37, 111, 111, 74, 111, 1111, 37, 1111, 111, 1, 111, 1111, 37, 3, 111, 74, 111, 271, 37, 11111, 1, 74, 111, 111111, 37, 79365, 3333, ...

Examples

			a(10) = 19 because 19+91 = 110 is divisible by 10.
a(18) = 102 because 12+21+102+120+201+210 is divisible by 18.
		

Crossrefs

Cf. A045876.

Programs

Previous Showing 11-20 of 27 results. Next