CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 21:59:56 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=21ac28780e87d280e0d37db3d1ec8d3171a749cc9b4df28e68a65b05a13f00e6a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22k-F34mTja9krieJSB8QpcIQV1GfH5E7b%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d9ddfcdefd8cf1-BLR
PARI sourcecode for demo in A055881 - Pastebin.com
SHARE
TWEET

PARI sourcecode for demo in A055881
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This demonstrative program should be used for either documentation or instructive purposes only,
- and goes without any warranty whatsoever.
- This is part of: The On-Line Encyclopedia Of Integer Sequences OEIS(TM)
- Visit: https://www.oeis.org/A055881
- Author: Joerg Arndt (www.jjj.de), Dec 12 2012
- Pastebin by: R. J. Cano ([email protected]), Dec 17 2012
- */
- perm(n)=
- /* Compute the first n! terms of A055881 by counting
- in rising factorial base.
- Generate all permutations of n along the way.
- */
- {
- my( fc=vector(n) ); /* mixed radix numbers (rising factorial base) */
- my( ct=0, j, a=0 );
- my( p=vector(n,k,k-1) ); /* permutation */
- my( k, t ); /* for permutations */
- while ( 1,
- print1(ct, ": ", p); /* permutation */
- print1(" ", a ); /* A055881(ct): position of rightmost change in fc[] */
- print1(" ", fc); /* factorial number */
- print();
- ct += 1;
- /* increment factorial number fc[]: */
- j = 1;
- while ( fc[j] == j, fc[j]=0; j+=1; ); /* scan over nines */
- if ( j==n, return() ); /* current is last */
- fc[j] += 1;
- /* update permutation p[], reverse prefix of length j+1: */
- a = j; /* next term of A055881 */
- j += 1; k = 1;
- while ( k < j,
- t=p[j]; p[j]=p[k]; p[k]=t;
- k+=1; j-=1;
- );
- );
- }
- print("Demonstration: Reproduces the example given in the comments section for A055881");
- perm(4);
- print(" ");
- print("You are free to call perm() and experiment with it. When finished, type \"quit\" to exit.");
- print(" ");
Advertisement
Add Comment
Please, Sign In to add comment
-
π Swapzone +37% glitch
JavaScript | 4 sec ago | 0.24 KB
-
β
Marketplace Glitch β
Working NEVER SEEN BE...
JavaScript | 9 sec ago | 0.25 KB
-
βββMAKE $9OO INSTANTLY D Gββ
Java | 11 sec ago | 0.15 KB
-
β‘ Crypto Swap Glitch β
Working β‘
JavaScript | 13 sec ago | 0.24 KB
-
ββ
Exploit 2500$ in 15 Minutesβββ W
JavaScript | 18 sec ago | 0.25 KB
-
π ChangeNOW Exploit
JavaScript | 25 sec ago | 0.24 KB
-
π EASY MONEY GUIDE β
Working S
JavaScript | 26 sec ago | 0.25 KB
-
π¨ Free Crypto Method π¨
JavaScript | 35 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand